> At some point the only lever left to pull is outright banning of foreigners.
That does not follow at all. If you look at the actual densities Barcelona is 1/3 as dense as the densest city in the world. There is plenty of room to accommodate more housing, they just need to build higher.