Determining speed of turbocharger via sound?
For 40kHz you're in ultrasonic territory. You'll be hard-pressed to find an ultrasonic mic that's also rated for high-temperature.

This one is rated for a maximum of 100C, and shows a response curve to 80kHz:
SPH0641LU4H-1

https://www.digikey.ca/product-detail/en/knowles/SPH0641LU4H-1/423-1402-2-ND/5332438

This one only covers up to 40kHz and 85C:

https://www.digikey.ca/product-detail/en/tdk-invensense/ICS-41350/1428-1064-1-ND/6025660

You might be able to create a temperature-shielded or cooled housing that's acoustically conductive, but YMMV.