I have some AMS1117 3v3 voltage regulators lying around. Could that work?
No they are not stable when used as a rapid voltage switch.
Resistors can be used but this slows down the edges of the signal and that can lead to trouble especially at higher frequencies.
I use open collector buffers like the 74LS07.