safe negative voltage divider to GPIO pins
I would replace D1 with a 3.3V Zener diode, and flip it around so that the anode connects to the battery and the cathode connects to R1. This will prevent the battery from pulling the microcontroller inputs below about 0.2V, and it won't draw any significant current when the digital pin is floating (or set to 0).

I was trying to draw the schematic for you but the schematic editor is not playing nicely with my browser right now.