All in, at the end of my wife's training, we would have been $1M ahead if she had simply worked a normal career. That's huge in your 20's and 30's when your trying to establish a house/family/etc.
As a baseline, university education in Finland costs about €10k/year on the average. Medical education is more expensive than the average, probably between €15k and €20k a year. Universities in the US are generally better funded than those in Finland, which allows them to provide more personal attention to the students. And university salaries are higher in the US than in Finland.
Overall, I would estimate something like $20k/year for the undergraduate degree and $30k to $40k/year for the medical school, for a total of $200k to $240k. And that's just for the education, not including costs of living as a student.
There are a handful of state medical schools near the $40k/r, but they are on the much cheaper end
A vicious cycle here is that student loans rise with expected earnings and banks are fairly open ended about it, institutions happy to justify the use of the cash.
Salaries wouldn't need to be nearly as high if you didn't walk out of residency with 300-500k debt (or worse). As a society we'd probably be better off if the both the median salary and median debt was much lower.
It's also part of the driver to overspecialization, more available GP's and fewer people reliant on emergency visits would obviously improve the system, but the economics and QOL for a general practice keep getting harder.
Residency bottleneck and the high barrier for foreign trained mid-career people are the two other areas for potentially major impact.