There may be no clear and complete answer, but there is one very robust partial answer. Land Value Taxation makes a lot of sense and appears to function as more or less as intended where it is adopted. There are many other factors involved, but moving away from unbalanced subsidies like the mortgage interest deduction toward systematically appropriate taxation could help a great deal.
The problem with only locals buying property are many, but mainly that prices stagnate. That is not bad per se, but there is a voting sector that doesn't want price stagnation (older people basically). Governments in Australia have used foreign investment rules as a kind of secondary economic switch to keep prices going up, to the benefit of some, the chagrin of others, and ultimately maintain a status quo that benefits politicians.
It's a tough problem, property prices, and one with no clear right or wrong answer.