I generally think that MAME should always output lossless formats; leave the conversions to an external tool afterwards.
Trying to reduce down tapes etc.to formats such as cas, tzx etc. has caused so many problems over the years due to ambiguity in the specifications, as well as features being added then dropped. This has resulted in different encoders producing different results, sometimes conflicting with the output of other encoders and giving us cases where no one decoder can decode everything. The knock-on effect of this is decoders flip-flopping between supporting the output of one piece of software and another.
There are there are just too many 'badly' encoded files out there without MAME contributing to that by also supporting such things as these custom output formats, again to our own interpretation of the specifications.
In most cases we would have been better off just keeping the wav files, and maybe using a lossless encoder such as FLAC on them.
The same happened with CDs; and floppy images; different software implementing things in different ways, often resulting in images that are only 100% compatible with the software they were created with, despite using 'standard' formats.