I want to discharge a capacitor with an Arduino digital pin. Which of these two circuits is safer for the board?
As the Atmega328 datahseet states the current on the IO pins should not exced 40mA. "Stresses beyond those ... “Absolute Maximum Ratings” may cause permanent damage to the device." But for short periods of time(microseconds) and low energies you may exced those limits.
You can use the first circuit as long as you have at least a 125Ω resistor in series (to ensure a current of 40mA if working with 5V).
Also you should consider that the IO pins are not simple switches. They have an internal resistance, capacitance and induncatce (that vary with temperature). Also the pins have clamping diodes connected to the MCU ground and VCC.
If your aim is to measure capacitance I think that it's possible to avoid the 555 and measure the time it takes to charge/discharge the cap using timers and ADC. Atmel do this to implement the QTouchADC (http://ww1.microchip.com/downloads/en/AppNotes/doc8497.pdf). It's a capacitive touch sensor aproach. You can find code for this in github as reference to control all the peripherials.