If the math works out for some people, they should do what's best for them. But I don't really think that is the case most of the time. Living in a modest apartment and using your bike is almost always less expensive.
In London a basic 3 or 4 bed house on the outskirts will be perhaps £700-1,000,000. Same thing half way in will be £1.5-2mil, anything within a short walk or bike ride of any central office will be £3 or £4 million at least (assuming you can even find anything "normal" in terms of housing). An entry-level Tesla is £40k, and a "good" non-FAANG SWE salary might be £75-100k.
Sure you can get a smaller apartment in central London for less, but then the same apartment in central London will still be 3x 4x 5x the equivalent on the outskirts.
Either way there is no parking in central London anyway so driving to work is not viable.
> there is no parking in central London anyway so driving to work is not viable.
By "closer to work", I didn't mean you need to buy the house closest to the center of London. I meant you can rent (or buy, if you have the capital) a flat near public transit, or bicycle-friendly infrastructure. Of course these options vary significantly, but even in my car-infested U.S. city there are decent options.
Also, I don't think it's honest to compare the sticker price of a car vs. a house. If you are in the market to buy a house, good for you. But my argument is more along these lines: put the monthly $$$ you would put into a car, into your rent instead. Get the best place you can, and you'll likely be happier than if you lived deep in a suburb. Of course not everyone will agree with this, but I don't think it's entirely unreasonable.
Definitely put some thought into where you live, but it's always a compromise and for a lot of us it's unavoidable that it'll be 15-20 miles of commute.
Another option, a 2019 eGolf is $17,000 with 120 mile range used with 36900 miles and still has some warranty remaining on battery + drive train.
I think those are comparable to gas alternatives. If you factor in gas savings, the monthly payment starts to work out for a ton of long commuters. Then, once you pay off the loan it's insane how much you save. I pay $116/mo for insurance and $350/yr on reg for my 2019 model 3 now that I've been driving for the last 4.5 years. If you have to charge at superchargers it's less savings, but if you can charge in a garage or at home it's about $30-40/mo to charge vs $160-200 /mo I was paying in gas.
Moving closer to the city can cost $500+/mo more than living farther outside the city for a similar sqft place. Plus you get cleaner air, quieter environment away from the main city. Some people don't like city living.