Good! You're most of the way to a rational and compassionate response to drug addiction. Let's see if we can get you further.
Methadone maintenance therapy leaves several problems, starting with the fact that other opioids still feel good and are still being profitably sold on the street. There's supply and demand, right there.
The illegality makes it expensive. Most opioid users start with pills, and continue to injection because heroin and analogues are expensive, and injection works better. Unfortunately it's also a much better way to kill yourself, as is taking what you think is one drug (such as heroin) and lacing it with a stronger one (such as fentanyl). It's possible to kill yourself with a bunch of pills of a known opioid of a guaranteed strength, but it's pretty tough to do by accident.
So let's remove the profit motive, by letting the state take over the sale of opioids. No advertising, of course, and this is done in settings where help can be made available to anyone who wants to quit being addicted to drugs. Make it expensive enough that it isn't the cheapest way to have a good time (opioids cost basis is very low), but not so high that constant petty crime is the only way to stay high. Limit purchase quantities; maybe give known addicts a license, so they can have a slightly higher limit to account for their tolerance. A little bit will leak onto the street, sure, that's tolerable compared to a hundred kilos at once arriving from overseas or the southern border.
This puts the dealers out of business, clears out the Tenderloin, reduces opioid overdoses, puts addicts where they can get help, and reduces the burden on our overcrowded prisons. Evidence from Switzerland and Portugal suggest that over time it will also reduce the number of opioid addicts.
All in all, pretty big win.