The biggest acute risks from drug use are largely overdose related. Having ready access to narcan solves some of it. But issues with actual potency being incredibly unreliable are another huge risk factor that kills a lot of people, and regulated and tested drugs solves that.
Legalization makes huge headway on the acute overdose related risks. It doesn't solve all of the issues, but neither has criminalization and prosecution. I am skeptical of societal taboos doing it either, because I have seen people in my life fall into opioid addiction, and all of them were ashamed about it. I have spoken to people on the street about it, and they're ashamed to be living in tents with any money they come into going straight into more drugs. It's anecdotal, obviously, but it has been so universal that I find it incredibly unlikely that piling more shame on top of people who are already deeply ashamed of their current state in life is going to force any significant number to suddenly clean up their act.