I know you wanted to make a general point but in Arch you can just change PKGEXT='.pkg.tar' in /etc/makepkg.conf and the compression stage is skipped.
https://wiki.archlinux.org/title/makepkg
Tar would also be the answer to how to do fake compression (keeping files together and in order in one file) IF you can choose the "compression" library/tool.