I think this could be managed with an appropriate regularity framework that I think should probably apply to psychoactive drugs as well. This would be some sort of licensing system. Anyone can get a license to buy antibiotics but it requires taking class and passing a test that demonstrates you understand the risks and agreeing to follow certain rules and procedures. A procedure for antibiotics might be that you agree you'll only purchase them if you have tested positive for a bacterial infection. All drugs should only be purchased for yourself (unless you have a distribution license which should be more difficult to get). If you get caught breaking any of those rules, you lose your license for some period of time and are subject to other penalties.
I think for something like antibiotics, no one would bother getting licenses as it's not worth the time of getting and keeping your license up to date (licenses would likely require annual renewal and continuing education). You'd just go through your doctor the couple times a decade you need them. But this could be hugely beneficial for a diabetic person that doesn't want to go to a doctor once a month to get their insulin prescription renewed. Or women that want birth control without paying doctor fees. Yes, it would result in less revenue going to our medical system but that seems like a plus side in those cases.
I don't deny that some drugs are incredibly dangerous but our society allows a lot of dangerous activities. If I want to buy a BASE jumping rig, I could do that and then start legally jumping off of cliffs with it as soon as it arrived. My chances of dying doing that are far higher than my chances of dying while taking most drugs (maybe some like fentanyl are exceptions). Would you consider whoever sold me the rig a murderer? Or do you think I'm an adult and should be allowed to make my own decisions as long as they're well informed?