Eh, not really? If you have money to invest after rent, you’ll also have money to invest after mortgage payments.
I have decades of data on this in a few locales (including Bay Area and Seattle) based on my own experience and despite buying and (still) owning homes several times. It never pays out better than renting and investing. The math doesn't math. I still buy places occasionally but I am honest about this reality.
For the kinds of places I rent the finance math is so heavily tilted toward renting that it is a no-brainer. I'm not alone in this; I know many people of means that choose to rent even though they could buy any house they wanted.