Using an underpainting and painting a gradient on top of another, with gouache
Use acrylic paint as an underpainting. It can be safely used in combination with gouache. To retain as much as possible of the character of a gouache painting (the matte look and texture), I suggest diluting it nevertheless, which, in addition, will help keep an eventual underdrawing visible and improves adhesion (based on the discussion here, it otherwise seems best for adhesion to use a matte medium over the acrylics before continuing with the gouache, or to add gum arabic to your gouache). Please do some tests with this in advance, though: too much dilution will compromise the binding properties of the acrylic.
Shelf-life is not optimal, but better than casein and tempera, and you can cover your palette/dish/container with cellophane to effectively slow down the drying process whenever you take a break.
Acrylic is flexible even after drying, and can be safely used on paper, canvas, and panel.

Use tempera to create your underpainting. After drying, it will be insoluble. It is known for its durability. During the renaissance, even after losing its popularity, this was still regularly used as underpainting for oil paintings because of this characteristic.
On a layer of tempera it's easier to create gradients using gouache.
Egg tempera is also fairly easy to make, and it won't interfere with the appearance of the gouache that's applied on top of it.

Another way to keep your underdrawing intact when working on panel, and without having to resort to (organic) mediums, is by engraving or incising your linework. You can also indent lines on non-hardened gesso. You will be able to see the depressed lines even after several layers of thin paint, but of course they might remain
Of course, this technique is dependent on your artistic style.