I know most engines are super reliable today, but do manufacturers do anything to at least make an explosion result in the least damage possible?
The most (kinetic) energy is in the fan and turbine blades and disc. The engine is enclosed in a containment chamber whose purpose it is to protect the rest of the airplane from shrapnel in case of a fan disc or fan blade failure. Here's a video of a test where a fan blade failure is simulated:As you can see, the fan blade more or less completely destroys the engine, but no debris or shrapnel leaves the containment chamber.
Unfortunately, the turbine disc and blades have too much energy to be realistically containable. (In other words: the required shielding would be too thick and heavy.)
Engine failures where debris or shrapnel is able to leave the containment chamber is called an uncontained engine failure, and they are very rare, but they still do happen.
Since it is impossible to contain a turbine blade or disc failure, risks are mitigated in different ways, e.g. by requiring regular, very detailed inspections and extremely tight tolerances.
The main place engine manufacturers will focus on minimizing damage is with the large fan at the front of a turbofan engine. FAA Advisory Circular 33-5 discusses the regulations that cover this. The manufacturer must show that the worst case blade rotating at the highest RPM can successfully be contained. Only 15 seconds after the event is the operator allowed to adjust engine controls. The engine and related structure must also be able to withstand the resulting imbalance for the rest of the flight, especially for ETOPS certification. While the windmilling engine will produce drag, the aircraft will still remain controllable.
However, an engine failure is an extremely dynamic event, dissipating large amounts of energy. It's up to the aircraft manufacturer to ensure the engines do not pose a threat to safety of flight in the event of an uncontained engine failure. FAA Advisory Circular 20-128A discusses some of the methods on minimizing the hazards of an uncontained engine failure on the airplane. Below is a figure from this document showing typical locations of systems in the fuselage.
Each critical system will have redundancy, and is routed such that debris from an engine failure cannot damage enough systems to prevent safety of flight. Below, tail mounted engine is shown, plotting debris paths versus systems locations.
The FAA also published a report on Large Engine Uncontained Debris Analysis. This report is full of statistics and photos of damage caused by uncontained engine failures. Analysis considers the size of the debris involved, the speed at which it impacts other structure, and relative angles between the debris and impact surface.
One of the most critical systems to protect in a twin-engine airplane is the remaining engine. Shielding may be required to prevent debris from one engine from crossing over and damaging critical parts of the other engine. Manufacturers have also sought patents on ways of tilting the engines to keep them out of each other's debris paths.
New technologies such as open rotor fans present additional challenges to protect the aircraft from a blade failure, as there is no fan case to contain them.
A jet engine may not contain a severe explosion (for whatever reason) but there are various mandated things that are put in place to help protect the airframe.
- The engines are generally mounted such that they shear off cleanly and away from the airframe.
- There are a few AC's like this one and this one that discuss how to deal with and comply with various safety regulations around unconfined blade failure and unconfined rotor failure, as well as this one about pylon loading.
- Jets are generally produced to a very high standard to prevent issues from happening in the first place which is in a way a safety consideration.
Cowlings can be designed to contain fan failures but if the core comes apart you have some pretty high velocity shrapnel coming out that nothing short of quarter inch armour plate will stop.
The main design feature you typically see to mitigate burst risk is the placement of cable runs and hydraulic runs, where there are redundant runs, spaced apart in the fuselage to reduce this risk of shrapnel taking out all of the cable runs from a burst (as happened with that DC-10 all those years ago, because they were forced to run right next to the tail engine to get to the fin). You might also see strategically placed armour plates located between a cable run and the turbine disc, where a single run is critical for safety.
Beyond that, control of risk is mostly about maintenance and inspection of the components, same as with things like primary structure. When turbine bursts happen it's usually because of some microscopic manufacturing flaw in the disc that went undetected and falls into the random s--t happens category. As I like to say, it's a dangerous world for everybody but rocks.