AFAIK, the noise cancelling is done on-board the headphones – no audio from the headphones used for noise cancelling reaches the iOS device itself at all.
Also, there's no API for the Airpods to control or even detect the state of the noise cancelling. You'd be reliant on the user to turn off noise cancelling themselves.
You can channel microphone data (input) from the Airpods and use it to generate audio output to the headphones using standard audio APIs, but this would already be processed by the headphones (doing any noise cancelling on the audio input), and would be subject to headphone-device roundtrip latency (which would ruin any noise cancelling phase effects you were planning) and the audio output from the device would also be subject to whatever magic they're doing on the headphone output side as well.
All noise cancelling headphones do the noise cancelling on-board the device to minimise latency and guarantee phase cancellation. Tapping into this pipeline is all but impossible. If you're even looking to switch off noise cancelling via an API, you'd be looking for headphones which have an open API (or even any API) and allow that. AFAIK I don't think there are any that have that capability.
I think the only way to do this would be to build your own headphones, attach microphones for noise cancelling and then write an app to process this data on the iOS device, but you'd still be subject to the roundtrip issue (unless they were wired), and so we return to the onboard microprocessor again. If this is for a fun and small-scale project, it might be doable! Good luck.