Prep: peel and cube the squash into 1-inch pieces, cut the long beans into 2-inch pieces, slice the onion, mince the garlic and pat the shrimp dry.
Heat the oil in a wide pan over medium-high heat. Sear the shrimp in one layer for about 1 minute per side, until just pink but not fully cooked. Transfer to a plate.
Lower the heat to medium. Cook the onion for 2 minutes until soft, then add the garlic and ginger for 30 seconds. Push them aside, fry the bagoong in the clear spot for 1 minute, then stir everything together.
Pour in the coconut milk and water, scraping the pan. Bring to a gentle simmer (do not boil hard), add the squash and simmer uncovered for 8 to 10 minutes, until a fork slides in with light resistance.
Add the long beans and chili, if using. Simmer for 3 to 4 minutes, until the beans are bright green and tender-crisp. Add a splash of water if the sauce gets too thick.
Return the shrimp and their juices to the pan with the coconut cream and greens, if using. Cook 1 to 2 minutes, until the shrimp are opaque throughout (145°F / 63°C).
Season with fish sauce and black pepper to taste. Rest for 2 minutes off the heat, then serve hot with steamed rice.