1) Enter into the car, just sit on the driver's seat OR press brake pedal without sitting - this should turn the ignition on.
2) Press accelerator pedal 10 times, proceed as normal with setting the pin code.
3) Turn the ignition off by getting out of the vehicle (leave driver's seat and open driver's door) OR turn the ignition off from the screen. Please note that the procedure must be completed within 30 seconds.
In the on-screen menu, middle screen: safety → power off (on the very bottom)
Tags: Setting PIN code in Teslas, Tesla PIN code setting