Cut the pumpkin into half, remove the seeds and strings, and cut the flesh into 1.5 cm / ½ inch cubes.
Parboil the pumpkin in salted water for 2-3 minutes. Drain the pumpkin.
Heat the oil in a large pot and sauté the onion and garlic 2 minutes. Add the bell pepper and, if using, the chili pepper and sauté for 1 more minute. Add the spices and cook briefly. Mix in the pumpkin, chopped tomatoes, and broth.
Bring to a simmer, then turn the heat down and cover the pan. Let simmer for about 30 minutes (this helps the flavors to develop), stir every now and then. Season with salt and pepper.
Add the beans, stir, and let simmer for 10 more minutes, until the chili has slightly thickened. Finally mix in the chocolate. Stir well until the chocolate has melted completely. Taste and adjust the seasoning.
Ladle into bowls together with some cooked quinoa or rice. Top with avocado, sour cream, cilantro, lime juice, and pickled red onion (see note). Serve with tortillas.