a step-up will only increase the problem of high resistance switches
and those optos are not only high resistance, they are also slow as molasses
Thanks for pointing out the speed issue; that's another reason to avoid optocouplers. I don't see why one would use them in a 3.7 V system. And I don't see the point in transformers either for driving a small low-impedance speaker.
I will try the small H bridge (DRV8212), which I would consider the most elegant solution. But will also order a small integrated class D amp with internal PWM generation (PAM8302) as a fallback; maybe the dual-PWM beat frequency I am concerned about is not an issue in practice. And I do have a few small class AB amplifier ICs around -- they definitely work, but get less power to the speaker than I would like.
Thanks again to all who have provided advice!