Given that barf is already using the filename to indicate the compression, why not just move the final byte of the file into the filename instead? Something like,
head -c -1 "$file" > "$file$(tail -c1 "$file")"
EDIT: Obviously this has the corner case of null bytes