Heat a large saucepan or Dutch oven on medium-high heat. Add the olive oil, and once it’s shimmering, add the onions and season with salt. Stir frequently and cook the onions until a light brown fond starts form on the surface of the pan, about 5 minutes. Add a few spoons of water to deglaze the pan. Continue cooking the onions, adding more water every few minutes and stirring frequently to prevent burning, until they’re browned and fully softened, 8- 10 minutes.
Add the garlic, jalapeño peppers, and tomato paste, and cook for 2-3 minutes or until tomato paste is darker in color. If the mixture appears to dry out, add a bit more water and scrape up any browned bits.
Stir in the Spices (chili powder, cumin, oregano, paprika) and stir vigorously for 30 seconds, again adding a spoon of water as needed to prevent drying out.
Pour in the vegetable broth to deglaze the pot, stirring up any browned bits. Add the cocoa powder, bay leaf, 1 ½ teaspoons kosher salt, black pepper to taste, pinto beans, diced sweet potatoes, chipotle peppers (if using), and diced tomatoes. Stir well.
Bring the chili to a simmer and maintain a rapid simmer for 30 minutes, stirring occasionally and reducing the heat as needed, until the sweet potatoes are fully tender and the chili is thick and almost velvety.
Discard the bay leaf. Stir in the masa harina, if using. Whisk to combine and simmer for 2-3 minutes until the texture has further thickened. Stir in the cilantro (if using) and the lime juice. Taste for seasonings.1. NOTE: keep in mind that chili always tastes better after it has rested for some time, as the spices will have a chance to mellow out and meld together.