40V burning Arduino Nano?

I assume "a transistor buffer" is like this:

No that is called an emitter follower, you want the configuration where the emitter is connected to ground and the collector, resistor and input pin are all connected together. The the other end of the resistor goes to Vcc.

This means any input voltage is shunted off to ground through the base / emitter junction.