I hypothesize that most of the stimulant use is actually due to poor sleep hygiene and jacked circadian rhythms, because of electricity and lighting on-demand.
There's a fine line, as with alcohol. A single cup of tea might feel refreshing. A monster energy drink is going to feel like a fight or flight response. Some people are also more sensitive than others and some are addicted more really than others.
I was on a prescribed stimulant for 6 months. It was nice for work, but it ended up with too many side effects that kind of mess with ones head. It tends to "simplify" complex decision making processes and not just for code but for life decisions.
I do find the economics / work narrative relatively unconvincing. For one workload in the developed world has fallen by about 40-50% over the last 100 years. Consuming stimulants is as popular among call it the 'lazy bum class' (no offense, I grew up in a deadbeat town) as it is among strivers. Coffee goes back five thousand years, Nicotine as far as recorded history, that is 10k+ years.
They've always had recreational or even ritual use, and the health fads against stimulants and cleansing crazes usually come from the work-obsessed than anyone else. So I don't think that we run on stimulants, I'm pretty sure we'd do them regardless.
reply