Hmm, maybe one of these (crank based three speed gearbox) would not impede the fold.
Gearbox | Efneo
Interesting..it looks like a Patterson Transmission, but with one more gear, simpler installation, and a dedicated shifter. Nice.
http://pattersonbike.com/