Simpler and quicker solution is for pilots to wear an oxygen monitor. I have a Wellue O2 ring that monitors my oxygen level and vibrates when low, increasing in intensity if it doesn’t rise. While asleep it can nudge me to move and breathe better, and has woken me up when I didn’t do enough to improve my breathing (I do use both CPAP and oxygen). If the pilot had been wearing one (wireless, very comfortable) he would have known his oxygen level was dropping and been able to do something in time.
Good point.