You might find how the Netherlands handles drugs interesting:
https://en.wikipedia.org/wiki/Drug_policy_of_the_Netherlands
In short, they classify drugs as either hard drugs which are likely to lead to addition, and soft drugs. While drugs are technically illegal, which is in part due to international pressure and treaties, they're not enforced, and "coffee shops" operate as local dispensaries. At the same time, they do take a hard stance against things like being under the influence of anything that impairs your ability to operate a vehicle. \
Apparently in 1998 they also implemented a heroin treatment program, which "has been lauded for considerably improving the health and social situation of opiate-dependent patients" Sounds like a big improvement and cost savings over cops, courts, and prisons, to me. The way I see it is, if you make it such that "junkies" have options other than turning to crime and black markets to feed their addiction, you take away the need to commit those crimes.