Build a 40M dipole with switches at the halfway points to disconnect half the antenna elements so it can resonate on 20M when desired...
I've done the same thing, but using color-coded Anderson connectors in place of the
switches. So the ARES 40/80/160m dipole has one junction in the middle of each side,
that is open for 40m, closed for 80m, and jumpered with a loading coil for 160m. The
instructions then say, "For 80m connect the green and yellow plugs", which makes it
easier for untrained operators to set it up. The 160m loading coil also has mating
connectors so it just plugs in.
That brings us back to a question about your original requirements: do you want to
be able to work both bands without having to change the antenna? If you switch
back and forth a lot, you'll probably want an antenna that handles both at the same
time, otherwise an antenna that can be switched between bands will work.