I don't have great citations on this, but my understanding is that Tokyo has done a good job at this mostly by aggressively continuing to build housing. The housing prices there have remained much more stable than those in SF for example.
Tokyo has grown by about as much as SF in last 20 years so it is a good example. Another good point of comparison is Vienna, Austria, which is larger than SF and growing faster.
They also don't speculate on real estate and tie wealth to it like we in the west do. My understanding is that housing is considered a sunken asset similar to a car when you account for the frequency of seismic activity and changing building standards to account for it.
Generally true in Japan but "Tower mansion" (high apartment) on Tokyo/Osaka is exceptional. It's considered as wealth.