Imagine it were legal to sell bottles of heroin in vending machines. What would happen to the price? How would the change in price affect the problems associated with heroin addiction (crime, job loss, overdose, etc)?
Most likely, major pharmaceutical companies would take over heroin sales the same way they sell aspirin. Indeed, heroin was once the brand name under which Bayer sold the drug over the counter.
How much does an addiction to black market heroin cost? Heroin addicts with a high tolerance take 1 shot of heroin (1 shot = 40-60 mg, injected intravenously) about 6-8 times/day.
So, dosage for heroin addicts with high tolerance peaks about about 500 mg/day. At a black market price of $150/g, an addict must spend about $75/day or $2250/month to satisfy their addiction.
Per capita median monthly income in the US is ~$3200/month, so a full blown heroin addiction doesn't leave much money for anything else. (Which is why so many opiate addicts turn to crime or prostitution to support their habits.)
If heroin were as cheap as aspirin, you could buy 100 tablets of 500 mg tablets for about $0.10/tablet. So, an addict could support their habit for about $0.10/day, $3/month, or $36/year.
At $36/year, even an almost entirely dysfunctional addict could satisfy their addiction by begging or collecting soda cans.
We should also expect the other following benefits from lowering the cost of heroin:
Lower crime, as addicts don't need to commit crimes to finance their habit.
No street violence between rival gangs.
No funding for terrorists like ISIS / FARC.
No need for addicts to prostitute themselves.
No O/D deaths due to fentanyl hotspots in tainted drugs.
No O/D deaths due to dosage variation in black market drugs.
Fewer job losses due to addicts being imprisoned for heroin purchases.
On the downside, if heroin were legal, more people would probably use it. Heroin still poses a risk of overdose, even if it is not tainted with fentanyl and consistently dosed. But most addicts can live otherwise nearly normal lives, as long as they get their fix of heroin.