Hi, I want to program a nano 33 IoT whilst the board is powered by a battery. Presumably, powering the Arduino with a battery and then plugging in the micro usb at the same time will kill the board (maybe not?). Is it feasible to connect just the micro usb data pins (no vcc) to the Arduino's micro usb socket (whilst on battery power) and program it this way?
For example I could modify an existing micro usb cable, and remove the vcc pin.
If you connect a battery to Vin you would need to cut the USBvcc wire in the USB cable or remove the pin. You still need the GND (ground) connection.
Somewhat dangerous if you forget and use the wrong cable one day
No, it won't prevent overdischarge, it's there to protect the USB port and your computer.
If the battery voltage should ever drop below the USB bus voltage (5V) then the USB would send current into the battery and you don't want that to happen. The diode prevents that from happening.