Cocaine is a d2 reuptake inhibitor like AFAIK pretty much all notropics. But the speed of action and the short duration makes it very addictive. So I could readily believe people are smarter while on cocaine, just that gets shadowed by the focus on feeding the addiction.
I take modafinil which is slower and longer acting d2 reuptake inhibitor and am definitely smarter on it, it helps with my ADHD as I had dopamine dysregulation prior to taking modafinil. Because of that prior state I get a much stronger effect from it and require only a lower dose of it (50 to 100mg).