SF is already one of the most dense cities in the USA. If the government forbids people from building housing, they've historically done a poor job at it. They are the second most dense city in the USA after NYC, and no would accuse NYC of not being unaffordable either.
The real problem is that more people want to live in SF than they have allowed housing to be built for. But it isn't clear that if they went with Houston-style "anything goes", would they still be that desirable? Or only as desirable as less popular Houston?
Sf is 7 square miles. You can cut a swath out of that size out of other cities and find that density. Possibly more density. Koreatown in LA has like 45k people a square mile, over twice as dense as sf. Several other areas there clock in at a higher density too. Really you need to consider it as just a region in the greater Bay Area metro region. And given its prominence in position as a transit hub with billions invested over decades in just that effort, it makes sense to add density there.