perhaps a partial solution is harm reduction education and needle exchanges? understanding drug interactions, widespread availability of naxalone (narcan), differences in routes of administration, and bio-availability of a drug for that ROA are all incredibly important factors.
eliminate one source and another does indeed spring up, or the more barriers to an individuals preferred route of administration for their preferred drug frequently just makes that ROA more dangerous. For example, OCs vs. OPs--you can still break down an OP for IV use, but the additional expenses are intrinsically bad due to opportunity costs of time spent getting a fix, and the extra steps introduce additional harmful variables with each step needed in the purification/isolation process.
Also the war on drugs created the idea of cutting heroin with the much cheaper (and much more sedating) fentanyl. in a regulated industry this would not be possible. a deadly side effect of government policy, not an effect of opiods themselves. Humans have gotten along fine since the beginning with poppies. Synthetic drugs and hypodermic needles changed the game, now policy must adapt to the reality, like it or not.
Moreover, people need to differentiate between weekend warriors/chippers and regular users. Unless crossed with other downers (esp alcohol) the dose needed to get high for an occasional user is nowhere near what's needed to cause respiratory failure. many people would pass out before they could smoke or ingest a fatal amount, and when swallowed would be vomited back up anyway. High dose users, OTOH, are already much closer to what would be a fatal overdose if they misjudge their tolerance or the purity or change the ROA.
Yet another thing is all people who use or associate with users should be made aware naloxone is available over the counter immediately, no questions asked at most any pharmacy. this will reverse the effects of an overdose, and it takes awhile for your breathing to trail off. No reason everyone shouldn't have some in their trunk or in their medicine cabinet if affordable, even if they use prescribed amounts orally in pill form.
Lastly, consider that many of these accidental ODs are not accidents. It's by far the easiest way out if you have access and are trapped in a broken body or a life not worth living. the entire epidemic, and all substance abuse, is nearly always rooted in more fundamental problems for a person. Fix the basics and self medicating will largely stop. These deaths are indicative of more fundamental problems with our society, and these fundamental problems are gonna be getting worse for the foreseeable future.
Education and needle exchanges where u can get 0.02 micron wheel filters and antibiotics will stop many common problems with opioids used in IV form. In all cases education is the best way to prevent people from unknowingly putting themselves in danger, but at the end of the day there isn't gonna be much that can directly be done to curtail this trend except education.