There's a gas heater on the market that works by using rapidly moving vanes to induce shock waves in the gas. The outflow has the nearly the same pressure as the inflow, but the gas has been heated, potentially to a temperature higher than could be achieved by resistive heating elements. EDIT: I mistated this; see below for link.
Consider also that once the shock heated air around the reentry vehicle has expanded back to ambient pressure, it will be hotter than it initially was.
Similar to re-entry heating: the specific kinetic energy of the returning capsule is many times greater than would be required to melt and vaporize any material. So why do things survive re-entry? Because most of the energy is dissipated in the bow shock, significant distance away from from the capsule, where air gets heated to temperatures higher than the surface of the sun when other air slams into it. The purpose of the heatshield is to protect from radiative heating from the bow shock, not convective heating. Ablative heatshields do not work because ablation consumes energy which removes heat (again, there is sufficient energy going around to ablate the entire craft), but because they place a shade (made of ablated carbon particles) between the bow shock and the craft, which shields it from the radiative heating.
In this case the entry regime was such that convective heating far outweighed radiative heating.
I mistated slightly: the gas is accelerated to supersonic speed then slowed in a diffuser, where shock waves heat it.
When the gases decompress they'll be a lot cooler, just like your AC.
https://ntrs.nasa.gov/api/citations/20140012475/downloads/20... (see slide 7)