The only real answer is not to employ nicotine addicts at all but that would take a huge number of excellent pilots out of the system; could it cope?
Those excellent pilots could always stop smoking. If keeping their drug habit is more important than their career, then they are not excellent pilots.
Substance abuse is incompatible with safety in aviation.