Why don't airplane piston engines have mufflers?
Today, most GA aircraft in Europe do have mufflers so they can pass the ever more stringent noise requirements. Here is one mounted to a Cessna 172 (picture source):



Historically, mufflers were considered as a disadvantage because they reduce engine performance by increasing back pressure. By partially blocking the exhaust flow, the muffler increases cylinder pressure on the last upstroke of the cycle (the exhaust stroke) so it faces more resistance against moving up. Also, more of the burnt gasses remain in the cylinder so less fresh fuel-air mixture can be ingested in the next cycle. At most, in aircraft with an open cockpit a tube was installed to duct the exhaust gasses away from the pilot. Below is a picture of a Mercedes D.IIIa in a Fokker D VII (source):



However, night flying would make aircraft easily detectable by their exhaust flames, so in WW II tubes were added to the exhaust stack in order to avoid optical detection. Below is a picture of an Avro Lancaster with Bristol Hercules engines (source):



Our much better understanding of piston engines now allows to design mufflers which do not cause much power loss and in case of a tuned resonance muffler you even get more power at the design speed because a reflected pressure wave will arrive from the muffler at the exhaust port just when the valves close and will increase cylinder pressure. However, given the low RPM speeds of our old-fashioned aviation piston engines, those mufflers need to be large and the equally old airframe designs have no space for them. So in aviation the mufflers are still causing a power loss.