There was a commuter approach/landing accident in Aspen maybe 20 years ago in which cocaine was identified in a pilot's blood test. There was a big uproar, of course, and another pilot followed up with an article in an aviation magazine. He recommended drug tests be reduced in favor of daily performance tests. He suggested a video game kind of test in which a person would be scored primarily against his own record. If he failed, he would not be allowed to work that shift.
I never heard that this has been explored in the years since. It probably makes too much sense.
No, I'm not intending to defend alcohol or drug use, as I do neither.
GB