Here's a graph of the S&P 500's closing price for the last 100 years. It goes up and to the right, and since this is a logarithmic graph, the growth is dramatic. This is what long-term index fund investors point to as proof of their investing thesis.

Here's the chart of gold. Gold has also gone up over time, especially after the 1971 removal of the U.S. gold standard when the dollar became a free-floating fiat currency. It has had much longer periods of going sideways than the S&P, which has caused many to consider it a boring store of value rather than an investment.
What's interesting about gold is how stable it has been as a store of value throughout human civilization. An 8-gram Roman aureus from the 1st century BCE was worth a legionary's monthly salary and could buy 100-200 loaves of bread—roughly \(500–\)1,000 in today's dollars, similar to wages today.

Gold being a constant store of value throughout history is dubious, but it may be the best proxy we have besides real estate. If we assume it's roughly consistent, we can divide the S&P 500's price by gold to approximate the real value of stocks.

Viewed this way, the S&P 500 hasn't really gone up and to the right—it has gone mostly sideways. The boom and bust cycles of the U.S. economy become much more visible.
I find this perspective useful because most stock charts show nominal prices. When the news reports "The S&P made a new record high today," it's worth asking: in terms of what?
If we take this assumption seriously—that gold has remained constant while the dollar has devalued—the implications for long-term financial planning are interesting:
Hold gold in proportion to your risk tolerance. If stocks fluctuate around a mean, gold provides stability.
Buy stocks at the cheap end of the cycle. The SPX/gold ratio resembles a sine wave, so buying when it's low (and rising) could make sense.
If instead we assume dollar devaluation is guaranteed but gold isn't necessarily a perfect store of value, the strategy shifts:
Buy a broad basket of assets. If everything rises in nominal terms due to inflation, diversification captures that.
Use long-dated options (LEAPS) to go leveraged-long on inflation that markets may not fully price in.
This is not financial advice—just an interesting way to think about stock valuations.