This might not be what you mean, but there is a philosophical position that holds that all mathematical structures exist, and that our universe is simply one of these structures:
https://en.wikipedia.org/wiki/Mathematical_universe_hypothes...
The first of these isn't a coincidence; pure mathematics evolved from applied mathematics, which originally was the only kind, and which was specifically designed to handle nature. It has since departed from those roots, but is still guided by human intuition and æsthetic sense, both of which are deeply shaped by our experiences in the natural world.
(For a counter-argument from a much better source, see https://en.wikipedia.org/wiki/The_Unreasonable_Effectiveness... .)
Pure maths (as a tendency, not strictly) focuses on formal systems that are on the consistent end of the spectrum (as those are the ones that can be used to build more maths on top of). Nature probably doesn't (or needn't) have this restriction/tendency! Formally consistent might be higher performing in many cases (more stable over long time-spans, like dna), but it is not the end of the story as to what is ultimately possible in rule-following systems! Any sense of determinism demands this, even if the system makes its own rules as the universe/reality - the ultimate all, with nothing outside of it - must. Whether this fully gives way to a properly random (like an oracle of rand) system at the quantum level is still an open question.
It is possible to expand ones view of nature/ultimate-reality to include other rule-systems (such as including inconsistent or entirely 'complete' systems.) This can have more coverage (completeness) of any particular model, or even be totally incomplete and inconsistent! These 'degenerate' (according to maths) formal systems might sometimes be the ones that happen to work in nature/reality. Once you do this extension, now you're talking about computation, admitting a broader class of rule-following than pure maths. You can argue that the two are equivalent because sure, anything can be translated between them - i'm more talking about tendencies here. The computational universe includes lots of formal systems that are abhorrent or impractical to mathematical understanding, so mathematicians avoid them, but nonetheless they are still rule-following! Nature/evolution probably uses/finds those rules where they are the best performing solution (through its exploration of possibilities).
As to 'optimal end-states', I'm afraid you've lost me there. I gave up teleology (the idea that the universe or nature or evolution have any obvious goals) a long time ago, how could anything like that (high level) feed-in to reality? There is no hint of this in all of science. What self-organises and self-replicates is what persists. This self-support might even reach down into physics!
To me, religion is nearly the opposite to all of this: An explanatory system that says explanation-of-reality='fixed string' with no update method available. Very incomplete (unless ridiculously long, which current examples of religion are not) and inconsistent: The fixed string might assign True and False at once, or neither - to new knowledge that falls outside the original scope of its meaning.
So no, I don't think that this pi-result suggests that religion and science have a commonality here. Pi is awesome (even though very constructible) and we should probably expect to find it [0], especially in places like this (pure QM) that involve geometry.