We have metal pipes underground for 10+years. Can't powerwall handle that? Also you probably don't need full enclosure to be metal, can be some corrosion resistant material, and only metal heatsink.
Pipes leak all the time from corrosion or get penetrated by tree roots or get punctured by construction or get damaged in earthquakes.
Lithium batteries do not need external oxygen to burn and toxic smoke coming up from your backyard with no way to reach the source doesn't sound like a fun proposition.
How about corrosion resistant enclosure? And even it will be damaged (probability is probably low) you can have a sensor to detect that and replace the enclosure.
Batteries burning underground should be less a concern compared to them burning on a wood wall of a house.
In case of an incident circuit breaker will turn them off, and batteries will burn themself w/o damaging anything else.