The high energy X-ray probe (HEX-P): Resolving the nature of Sgr A* flares, compact object binaries and diffuse X-ray emission in the Galactic center and beyond