IIRC, the low life expectancy of hunter-gatherers is mostly due to the high infant/child mortality. You can see similar life expectancy graphs in several animal species. Basically, once you reach a certain age, you have a high probability of living up to a decently high age.
Regarding "Medicine, sanitation, pooping indoors", well, all of these became problems because of the Agricultural Revolution, where people lived in densely populated areas together with their domesticated animals. Diseases slowly spread from the animals to the humans, and the density and lack of sanitization increased mortality by helping disease spread quickly. The Agricultural Revolution also forced humans to do back breaking jobs for which our bodies were not built for (working hunched over in the fields, or carrying heavy weights on our backs), and shrunk our varied diet into mostly eating grains and grain-based foods.
So I think you should probably re-think your poor view of hunter-gatherer societies.