Things that cost the same everywhere cost the same in SF. Your 401k's cap is the same. Your smart phone is the same, your kid's college education will be the same (assuming they move anyway).
If you're dumping money in rent, that may or may not make you come up ahead with the above. If you dump your money in a mortgage instead...then you're -way- ahead, unless you're expecting a massive crash before you sell.
You can also do interesting things: home renovation doesn't magically get more expensive. Labor might be a little, but the price of wood and appliances doesn't significantly change, so you can go all out.
I don't live in SF, but I still live in a high cost area, and once that mortgage is in place, your disposable income shoots up the roof. That's basically the whole reason cost of living is so high...because for a lot of people, it's worth it.
Now, I'm not gonna argue against how messed up it is, privilege, how it screws the poor over, etc. That shit has to change sooner or later before we end up in another civil war. But as far as an individual software engineer goes, it can very well be totally worth it.