Preheat oven to 350 F / 177 C degrees. Lightly spray a sheet pan with nonstick cooking spray or brush with a small amount of oil. (Note: I previously always roasted the chilis and aromatics on a cooling rack over a sheet pan to increase air circulation while they roast as shown in the photos above. I no longer find it necessary to do this, and prefer to roast the ingredients directly on a sheet pan to save a step. I find the results to be very similar.)
Rinse the chilis under water to clean (no need to soak them). Use kitchen scissors to cut off and discard the stems. Shake out seeds to achieve your desired level of spice. (Note: If you leave all the seeds in, you will have a very spicy Nam Prik Pao, and if you remove nearly all the seeds it will barely be spicy at all. If you are hesitant about spice, remove as many seeds as you can the first time you make this. You can always set the seeds aside and add them back in during the final step.)
Toss chilis, shallots, and garlic cloves with 2 Tbsp oil. Spread out on sheet pan.
Place the sheet pan in the oven and roast until the chilis start to char and blacken in spots, 8 to 10 minutes, turning everything with a flat spatula halfway through cooking.
When chilis are charred, remove them from the sheet pan. Return the shallots and garlic to the oven and continue roasting until golden and tender, 10 to 15 minutes more.
Meanwhile, rinse the dried shiitake mushrooms under tap water (no need to soak them).
In the bowl of a food processor combine the chilis, shallots, garlic, shiitakes, tamarind paste, brown sugar, soy sauce, and 1/2 cup water. Turn the machine on and blend until smooth, adding additional water to create a thick paste.
Heat a large skillet over medium heat. Add 4 Tbsp oil. When oil begins to shimmer, add chili paste and cook, stirring frequently, until the paste becomes fragrant and turns dark, 6 to 8 minutes.
Taste the paste and add additional sugar or soy sauce, if needed to reach your desired balance of sweet / salty. If you reserved some of the chili seeds, you can add them back in and cook for a few minutes longer to increase the spice level.
Transfer to containers and refrigerate. Store in the refrigerator for up to 6 weeks.