Sure and that’s still not the majority of your income over a 10+ yr period if you’re getting paid good bay area wages as a senior+ engineer.
Not to mention that buying a house isn’t a requirement of living in a location (and isn’t the right financial choice for many places when comparing to rent).
A decent house in the Bay Area is >$2M. Why would I pay that when I can make the same money and buy a much better house for $500k, work from home, not have a commute (which is hideous in the BA) and not have some little micro manager breathing down my neck all day? It's a massive quality of life improvement all around.
That's not true, I definitely make the same money remotely that I would make anywhere else. Full remote companies don't care where you live and pay just as much as RTO places, often more.
I’m willing to bet this isn’t true for the average dev and you haven’t compared to in person pay from to companies, but there are definitely exceptions and sure it can be true for a particular person.
We’re talking about trade offs here right? Not saying you get everything.
But no I wouldn’t live in rural Arizona over the Bay Area or most cities unless there was a very strong extra reason to live there (like a manhattan project) and definitely not for a pay cut even if cost of living was near 0.