Building more housing is the best answer. It lowers the price because there is more supply. There simply aren’t enough homes in the Bay Area, NYC and many other major cities.
If you could build many large apartments in the Bay Area you could fill it with people who’d rather live there compared to a tiny old overpriced house. Zoning and existing residents stop that from being built though.