So there are two questions:
- Is it ethical to use a drug to enhance programmer productivity
- is it ethical to use this.drug to enhance productivity
Specifying this runs the risk of making things too localized, but it's also necessary information to properly evaluate the question.
You could take the ultra strict stance of "No, it's never ethical to use a drug to enhance your productivity." But depending upon what drug you're talking about, like caffeine, you may have just indicted the entire programming community.
Likewise, you could take the opposite stance of "Yes, always okay because it made you better" (whatever better may be). But that opens the door for many harmful substances that most would strongly disagree with.
Part of an ethical question is understanding the ramifications of a decision. And those ramifications span from the immediate to the long term as well as from the personal to others around the programmer.
By knowing the drug, we can weigh in on if the side-effects are sufficiently beneficial or not to merit use. If a hypothetical drug would allow me to program like nothing else but leave me in an impaired start to where I may harm others, then I think the answer would be no.
An additional factor is by knowing the drug, we can know the potential legal ramifications of use. Some might argue that cocaine makes them an amazing coder, but most jurisdictions and employment manuals have prohibitions against that. Even with a legal drug, it's necessary to weigh the likely employment guidelines that would be in place.
One final thing about disclosing more details of the drug and purported properties is that the disclosure acts as an anti-BS filter. It's not some abstract, hypothetical, it's a concrete question.
The first question alone is too broad to be answered in a single question; there's just too many variables. The second becomes more interesting.