Approach that math question with a time machine in mind.
I, too, live in a HCOL area. I would like to stay here forever, but I can't afford it, so I'll have to move after I retire.
I bought my house 2-1/2 years ago for $555,000, and it was/still somewhat is, a fixer upper. My neighbor bought his comparable house in 2000 for $199,000.
That means a 150% increase in value in 20 years. Since it's a HCOL area, I don't expect prices to go down again. On the contrary.
If I were to rent out my house, the rent would be around $2,800 per month. What would it cost to rent 20 years from now?
If my neighbor put down 20% back in 1999 (39,800) and refinanced when rates were low, his mortgage of $159,200 is about $1,200 per month.
So here is the answer to your question.
You live in a HCOL area. Would you rather pay $1,200 per month for 30 years, and then live rent free for the rest of your natural life and still own the place, worth many hundreds of thousands of dollars, or would you prefer to pay $2,800 now, $3,800 eventually, and $4,800 years later, even after retirement, and don't own any of it. That's the mathematical answer, and I personally think it's a no brainer.
Add to this the emotional component. I lived twice in a rented house that the landlord promised he would never, ever, not in a million, gazillion years sell. The first time, after living there for 13 years, I was graciously given 60 days to get the f*ck out of there. Due to my stellar credit, and the grace of God and all the angels combined, i was able to rent house 2. I was one of probably 25 applicants. Then, 2-1/2 years later, the landlords moved away and gave me, again, 60 days. In both instances I aged years do to the stress of no rental houses being available. You may enjoy that, but I never want to be at the grace of somebody else again.