I want to attach a Raspberry Pi to hardware I'm developing. There is already +5v and GND available on the hardware. Is there any way to power up my Raspberry Pi from this (I just wanna avoid another micro USB cable inside my hardware if possible). Is there any safe way to so it through any GPIO pins?.
You can’t power the Pi through GPIO, but you can power through the 5V and Gnd pins on the expansion header.
This is perfectly safe and acceptable, provided the supply complies. HATs often do this and the Foundation has compliance recommendations.
Indeed in some Pi models (including the Pi4) these are directly connected to the power connectors.