The current code in common/miscellaneous.c to detect whether or not it makes sense to compress only checks for bzip, gzip, zip and pgp compression. And as far as I can see it it also only does this when a filename is given directly to GnuPG. This would cause GPGME using callers never to have the advantage of disabled compression.
From a GPGME clients standpoint I wold probably prefer if this would be handled in GPGMEs data_identify as this can then be handled with a pipe IO for GnuPG when the underlying data is seekable.
Otherwise maybe just checking the file extension which we provide with --set-filename might already be a huge improvement, even without data /magic inspection.