Which Lumix? Some models I've seen samples of on imaging-resource have remarkably good noise behavior (or cunning noise reduction), so they can possibly afford underexposing a little more without the shadows becoming a mess.
I don't know how to write a curve that works with the CHDK curve feature, I haven't tried, but a curve in itself is simply a mapping between input values and output values, so, generally speaking, it can be described by something like this:
0 0
1 1
2 3
3 4
4 6
5 7
6 8
7 9
8 10
9 10
This would be a curve that stretched the shadows a bit and squashes the highlight (kind of the opposite of what you want, I just made numbers up). Of course, a real mapping is not made of 10 values, but rather 1024 if we're talking about 10 bits per pixel.
You probably want a curve much like the second one in the link I gave you.
My two cents: shoot a couple of photos raw (no matter how much you dislike that), then open them in your favorite photo editor and play with curves there.
Find a curve that pleases you (don't just try one picture, though, or you might easily be misled), and only then go on setting it up in CHDK itself.
And beware, anyway: although I haven't tried it, it's very likely that the custom curves feature slows down shooting. It's processing the raw data, and that takes time on the humble ARM chip we have.