From the start, I want to offend and repel most who might read this based on the title. If you are amused by chemicals that fuck your mind, go away. I am not interested in that case.
Are you curious about hacking the human mental engine? Aside from folklore, what do we know? Are there constructive chemical means to hack the mental engine? I do not know, but it seems likely. Whether anyone in the present has a substantial clue as to how this might be done - as yet I have not seen anything useful. Lots of folklore on this topic, but not so much fact.
Just to set the measure, I grew up in the 1960’s and 1970’s. I had good friends in high school who could have got me almost anything I wanted (of the not-legal drug nature), of which I did not make any use. I consumed quite a lot of alcohol in university, then stopped for no obvious reason. The effect of alcohol was only slightly interesting.
Fast-forward to the near-present, and reading of a programmer who worked mostly-intoxicated on Marijuana. Is it possible that this individual was more productive when affected by chemicals absorbed when ingesting Marijuana? Given that the nature of the human cognition engine is mostly unknown, this is at least possible. Also very possible is that the user might be distracted by the immediate pleasant effects, and not necessarily more productive.
Certainly there were times loaded up on cold medicines when I was unusually focused and productive. Also times when the same(?) stuff seemed to have the opposite effect. No idea why the difference. Sometimes coffee seems to help. Sometimes (maybe after too much coffee) a glass of wine seems to help.