Voltaire mocked Leibnitz (in the guise of Dr. Pangloss) for proposing that this is the ‘best of all possible worlds’. But it occurs to me that Leibnitz, as co-inventor of the calculus, knew the difference between local and global maxima. A global maximum is the largest value that a function reaches, for any input; whereas a local maximum is the largest value that a function reaches, in some neighborhood of the locally-maximizing input.
I therefore propose this modification of Panglossianism; Local Panglossianism, which states that this is the best of all sufficiently similar possible worlds. The world locally optimizes; it’s the best of all nearby possibilities.
Local optimization in fact applies in physics and biology, with, respectively, the least-action principle and adaptation.
Local Panglossianism leaves open the possibility of better worlds, but to get there you must first pass through worse worlds.