Prescriptions would just be doctors recommendations in this case. There could still be mechanisms to softly encourage only this usage, like insurance only covering doctor prescribed drugs.
Is your concern about painkiller addiction and abuse or about people hurting themselves by taking drugs without good understanding of them or something else?
I can get access to any drugs on earth, I'm still not going to try any random unprescribed med for the fun of it.
A prescription means your doctor said I think you need this, at this dosage, for this long. You can even get prescriptions for OTC stuff.
A prescription isn't a way to allow you to take something, it's a way to tell you what your doctor thinks you need.
A good chunk of the population operates this way right now. Also why pay a $150 kickback to doctors just to write something on a pad that probably shouldn't require a prescription in the first place?
And why the US created that setup (between the 1960s-80s) is a political discussion.
We're straying from the general premise here about about abolishing any legal limits on pharmaceuticals. Or else, we're changing the topic to an argument-from-consequences based on the idiosyncrasies of US healthcare and its costs.