If using whole chile pods, toast them on the griddle and then let them sit in boiling water for about 15-30 minutes. Drain chiles, reserve the soaking liquid. Discard stems and seeds. Add the soaked chiles or chile powder to the blender.
On a dry griddle (cast iron or stainless steel recommended), toast the onions and garlic, until charred on all sides. Allow to cool, then squeeze the garlic out of its skin and place in the blender.
On the same griddle, toast the cloves and allspice berries for about 1 minute, or until fragrant, then add to the blender
Add the spices, peanuts, cinnamon, cocoa/chocolate, pumpkin, stock, 1/2 cup chile soaking liquid (or an extra 1/2 cup stock, if using powder), sugar, and salt to a high-speed blender and puree until smooth.
In a large pot on medium heat, cook the pureed mixture for about 20 minutes, stirring occasionally.