I settled on writing .HDR files, but have managed to partly solve my problem (dead and hot pixels visible in DNG files) with a dedicated CHDK tool that can handle the RAW data, fix the bad pixels, and output to DNG. So I should be okayish for now.
I am probably missing many other obvious or fundamental concepts in my process, but hope to keep learning as I go.