Places on medical degrees are very competitive, and lots of keen and capable young people are turned away. As qualifying to be a doctor takes a lot of time and requires equipment and hospital use, the courses are very expensive (although, of course, the fees are currently paid back in line with earnings in the same way as for any other course). Training is ongoing post-qualification, which again adds to the cost. Yet medics regularly leave after all of that, and take their expertise with them.
How about we look at funding the training, increasing the number of students (without reducing the quality - many with very good A levels are rejected) but introducing a contract that requires some sort of payback if they leave? The details of that would be worked out with input from the doctors themselves, of course.
I'm not suggesting that people are held in the UK against their will, but that in return for free training they should have to pay back the expense of that (maybe in instalments out of their new higher salaries) if they leave before the cost has been recouped out of tax, after normal tax contributions are taken into account.
As has been discussed before, that sort of contract is not unusual in business. My son had postgrad qualifications paid for by his employer, on the understanding that he worked for them for X years afterwards. If he'd chosen to leave he could have, but either he or his new employer would have to pay back the cost of the courses he went on, plus a penalty as he'd be taking his new expertise to another company, and the old one would need to fund someone else to acquire it.
Knock-on effects would be that medicine as a profession would open up more to students from diverse backgrounds, as the training would be free, and we could train enough new staff to plan to fill expected vacancies year on year.