The saying isn't "The only way..." but "The best way...". Of course one may improve with all the things you mention, and it's a tongue-in-cheek statement anyway, but there's a grain of truth to it. I saw it quoted by one of the greatest teachers in golf, Harvey Penick.
One can enhance cognitive functions by strength training: https://pmc.ncbi.nlm.nih.gov/articles/PMC8534220/
Aside from time travel, the best way to improve in very important things is through strength training.