Thanks, Reyalp, that was it. Above ISO 800, raw files look identical regardless of the sensitivity displayed on screen. The JPEGs are simply brightened up by the camera (which explains why they look so bad). This brightening-up for some reason does not work when using CHDK's custom auto ISO, leading to "underexposed" JPEGs, but at anything above ISO 400 (or even 200), you are better off processing the raw files anyway.
At ISO 3200, the raw file produces gibberish when processed in DCRAW, probably because the pixel binning you've mentioned changes the file structure.
Thanks again,
Endre