There are times where the government, can, and should drop in and buy the entire IP associated with a medication. This price should be set with a council of various representatives, and it should not be something that the drug manufacturing company can reject.
Most of the research here is already partially funded by the tax payer through Government funds of colleges, etc etc anyway.
This isn't even something unheard of. The US has the power to unilaterally cancel patents.
Why not take the extra step then? Government funds the research, result is free-to-use for all.
Or: drug developed through research mostly at public institutions like universities etc? -> sorry, no patent 'protection' then.
Pharmaceutical companies could then produce whatever they consider worthwhile. But... squeezing buyers too hard? Competitor will step in with a cheaper offer.