I can do that in other metro areas, but I can't earn >$200k a year easily in other metro areas - not even close. Also don't forget about the beautiful weather year-round. I will have retirement money in my mid 30s and by 40 I can comfortably retire provided that I don't get hit by a car or suffer one of life's many random tragedies.
If I have a significant other who is also a high earner, then ironically both of our cost of living will go down because of things like splitting rent, splitting groceries, making food at home (easier to shop groceries for 2+ people). A dual income household in SF with good career trajectories can easily put you in the half-a-mil a year range.
It's the kids that make this infinitely more difficult. At that point I'd probably consider moving to a lower COL place. But I'm not sure I want kids - that's a decision for later.
As much as people love to knock on SF, I have a great life here and so do so many others. It's absolutely possible if you're a decent software engineer which is the lens through which I write this comment. Obviously if you're making $60k a year in a commoditized career, you're going to have a bad time. Also if home ownership is that important to you for some reason, then SF probably isn't the place for you either.