Heat the oil in a large, heavy-bottom pot over medium-high heat. Add the onions and cook for about 5 minutes, until softened. Add the garlic and ginger and cook for about 1 minute, until fragrant. Add the cardamom seeds, mustard seeds, cumin, coriander, turmeric, garam masala, and chiles and cook, stirring, until aromatic, about 1 minute, adding a tiny bit of water if the mixture starts to stick to the bottom of the pan. Add the pumpkin or squash, salt, vegetable stock, and coconut milk, bring to a simmer, then reduce the heat to medium-low and simmer until the pumpkin is starting to soften, about 20 minutes.