Check to see if I2C is switched on:
$ sudo raspi-config
Switch I2C off, unless it is used. If that is the case, see below how to use an altenative GPIO port.
$ sudo nano /boot/config.txt
dtoverlay=gpio-shutdown
Reboot
The Pi doesn't fully power off, just shuts down and goes to the very start of the boot sequence. At that point it sits and waits for pin 5 to be connected to a ground pin before continuing with the boot.
Please note, if you have I2C activated, physical pin 5 is the I2C Clock pin. If so, this shutdown method will NOT work!
dtoverlay=gpio-shutdown,gpio_pin=26
The gpio_pinis the GPIO number, not the physical pin number (GPIO26 = physical pin 37).
Please note, using an alternate GPIO pin will not provide a boot-up function as will pin 5.