Some evolutionary biologists suggest that animals that share wisdom or share childbearing duties with their offspring evolved to survive past fertility because doing so increases the competitiveness of their shared genes.
It might even be testable.
I often wonder if the Upper Paleolithic Revolution (https://en.wikipedia.org/wiki/Upper_Paleolithic_Revolution) could be correlated with genetic changes related to longevity. If the genes responsible for our double-lifetimes (we live about twice as long as you'd expect a mammal of our heart rate to survive) were small in number and had mutations that could be traced back to ~50 ky BP it would be strong evidence for this idea.
Even Aristotle knew about menopause. And Plato lived to be 80.
Staying fertile till we drop dead would be sub-optimal because germline stem cells (the "factories" that produce sperm and eggs) accumulate mutations as we age. Those mutations are useful as one of many mechanisms of evolution, but they must only occur in reasonable amounts, as they also increase the probability of nonviable offspring.
In short, protecting genetic information while still allowing evolution is a hard problem. This problem is not solved in exactly the same way by different organisms, and occurs on different time-scales.
"Best of all possible worlds" suggests a global maximum to me. Evolution can get stuck in local maxima.
In some ways, it seems like this is all that life on Earth is about. A planet-size computer running for billions of years to try and come up with a good solution to this problem.
Fertility is the main thing it optimizes. To think you know the way this should work better than evolution is like betting you know adwords better than Google.
In general it would be extremely safe to assume that human fertility is the best optimized part of the human genome and that in 1000 years we'll still be discovering factors that evolution took into account "designing" human fertility. There is (or will turn out to be) a very good reason for every single tiny detail about how our bodies procreate. If you can't see the reason, the fault is likely with you, and assuming otherwise is effectively betting against an algorithm that has had 3 billion years to ponder this question. It thinks slower than you, of course, but you're still quite unlikely to have the upper hand in that bet.
> does all kinds of glitchy seemingly suboptimal things so aging is not perfect and divine because it's evolution
This is how evolution works. It's called "mutation". And you're right. Species are a big fan of it, as it massively improves them. For the large, large majority of individuals, mutation is a small or large disaster.
Every human is an experiment meant to improve the human species as a whole. This is great if you're a successful experiment, but the extremely large majority of individuals in any species will be a failed experiment that don't get to propagate their genes (meaning the genes that are different in that particular individual). The vast majority of individuals will turn out to have a (usually small) weakness that will get filtered out. Usually that will be something like a toe that's a few millimeters shorter than most, sometimes it's ALS.
The key here is that evolution very likely won't decide any particular human is a success or failure until the human species gets into trouble again. When that happens, something like 98% or more of all lineages will go extinct, and until that happens, even evolution itself won't know or care what fitness even means.
Unless you know what is going to cause the human species to lose >90% of it's population at some point, you have no point of comparison.
This is more hedged than it really needs to be. In an infinite-integral-across-time sense, fertility is the only thing evolution optimizes.