How do I invert a signal without deforming it, and without using a logic gate?
Your first circuit is perfect... If you use a mosfet instead of a bjt. A mosfet does not pull anything low when it is on, it indeed is a capacitive load but you are going at 20kHz so that should not be an issue at all. Just be careful: your mosfet should support a quite high \$V_{GS}\$, i.e. 12V, that's not something all MOS are happy to do.

Your circuit should look like this:  







simulate this circuit &ndash; Schematic created using CircuitLab