If you have some magical formula that would avoid doing I'm sure that NICE would love to hear from you.
It's been put at about $10 million, for the purposes of EPA regulations. Insurance companies have their own formula, from a couple hundred thousand into the millions, and healthcare users QUALYs - quality-adjusted life years, and those are priced at $50,000-$150,000.
If governments were making their own generic drugs and sold them at cost then it would help avoid situations like Martin Shkreli. The drug wasn't protected by a patent, it's just that nobody else produced that drug. In my opinion this seems like a reasonable thing for governments to do.
Also, the best treatments aren't always available in this first place. Eg (at least a few years ago, don't know today) Adderall was illegal as a treatment here. Some EU countries, until recently, even treated methylphenidate like that.
Triple that in places like US (not for fubars but the costs).