That's perfect pqass.
I really wouldn't have thought of that.
So you're keeping the transistor biased at all times with the 10k going to the base?
Is the diode only there to protect the input from current flowing from VCC?
Will this be safe if I apply a square of say 0 to 10V at the base?
Maybe I should include a resistor in series with the input?
Yes, the 10k keeps the transistor on by default.
The diode is there to suck current away from the base to 0V when the input is 0V.
Notice the voltmeter says 658mV when input is 1V. That's the BE diode in the transistor.
So when the input is 1V, the diode is reverse biased and no current goes from input to base, therefore, no resistor required.
However, it may be necessary to use a schottky diode if a regular 1N4148 has a forward drop higher than the BE-drop.
Since the diode is reverse biased if input is greater than 0V, it doesn't matter how high the input can get (well, up to diode breakdown). What's important is that the input can get down to 0V. Or use a schottky and get ~200mV more headroom.