Granted, I am happy for you and I think drug laws are ridiculous.
If cocaine had positive effects that outweighed the negatives then it absolutely should be prescribed. But it doesn't. Unlike methylphenidate - which for most people has fairly mild downsides at the doses it is usually prescribed in. It is also largely non-addictive with little evidence of long-term health damage.
Also unlike cocaine.
All in all, I'm not sure how this comparison helps.
https://en.wikipedia.org/wiki/Methylphenidate
Though I'll grant you we don't have data for long-term effects.
https://www.sciencedirect.com/science/article/pii/S014976341...
Further, as you pointed out does have benefits (which is I assume why it's prescribed). Cocaine and meth have similar effects btw (pros and cons), abuse is what causes the issue(s). People can survive on both for decades though.
I'm talking about tasks I want to do but would struggle with without medication (mainly coding for pleasure).
Yeah - I could find different things to do with my life, but I love coding and I am delighted to find there's a simple pill I can take that helps me do more of it.