FWIW, there is LosslessEncode.c in the G7X firmware. I don't see it in sx280, or other pre-d6 cameras, even ones with native raw support. I have a vague memory that some compression routines were identified on very early cameras (hmm, maybe I'm remembering https://chdk.setepontos.com/index.php?topic=3038.10
which isn't really related ?)
To make it usefull on P&S cameras we need to find equivalent of "FA_CreateTestImage" function from DSLR.
On your G7X_100d look at 0xFCD4609C.
Factory mode functions could be one approach, but the normal raw process must also invoke it.
The factory mode functions on non-raw capable cameras include various mentions of craw / crw, but my impression (without having dug very deeply) is that they don't actually generate proper CRW files.
I should note I only posted the original link as something that might be interesting to investigate, not something I expect to be immediately useful.