I’ve been dabbling in this sort of stuff since I was 17, so I’ll throw some possibilities in.
When I started learning to code I would take piracetam, oxiracetam, and choline with coffee. Hard to say if it had any effect for sure, it could have equally been the ritual of it every day. Taking my expensive supplements was a commitment to learn for the next several hours. the period of time I was doing this regimen coincided with the bulk of my learning to code, although I can’t say conclusively the supplements played any real role.
This one might be a bit impractical, but I’ve read that learning a second spoken language increases cognitive performance. It’s a bit of a tall order to suggest anyone take up a second language while already studying coding. I myself occasionally pull up the memrise app on my tablet and try to learn some Japanese from time to time.
There are some studies on art and neuroplasticity, suggesting taking up art strengthens connections between parts of the brain. Whether this particularly helps any cognitive process involved with coding, I don’t know. But if you’re interested in this type of thing, an hour of lessons from the book “Drawing on the right side of the brain” or some figure drawing practice once in a while probably wont hurt.
if theres any supplement you want some quick info on, I’d recommend searching for it on examine.com . You can quickly get an idea of the weight of evidence and magnitude of effect on various parameters that have been studied.