Make the salsa. Spread the tomatillos, garlic and chiles onto a baking sheet and slide close up under a preheated broiler. After 5 or 6 minutes, when everything is blotchy black in places, flip them over and roast the other side. The chiles and garlic will be ready in a couple of minutes; the tomatillos will take 5 or 6 minutes longer. Scrape everything into a blender jar or food processor—juice and all—and add the cilantro. Cover loosely and blend to a coarse puree. Taste and season highly with salt, usually a scant 2 teaspoons. (You will have about 2 ½ cups of salsa) Turn the oven to 400 degrees.
Make the rajas. Roast the poblanos over an open flame (or close up under a broiler), turning regularly until the skin is uniformly blackened. Cover with a kitchen towel and cool until handleable. One by one, rub off the blackened skin, tear open and pull off and discard the stem and seed pod, then scrape out all the seeds that cling to the veins. Briefly rinse to remove stray seeds and bits of blackened skin. Slice the poblanos crosswise in ¼-inch strips.
In a very large (12-inch) skillet, heat the oil over medium-high. When hot, add the onion and stir regularly until richly browned, about 7 minutes—you want them browned, but still nicely crunchy. Stir in the poblanos and season with salt, usually about 1 teaspoon.
Layer and bake the pastel azteca. In a medium bowl, stir together the ricotta and crema (or one of its stand ins). Set out the corn, epazote (if using) and shredded cheese alongside the rajas and salsa. Brush or spray both sides of each tortilla with oil, slide them into a plastic bag (don’t seal) and microwave for 1 minute. Remove and let stand for a minute before you start layering.
Smear a light coating of salsa over the bottom of a 13x9-inch ovenproof baking dish. Next, cover the bottom with 5 tortillas: Cut 3 in half and line the flat sides around perimeter of the dish (2 halves on each long side, 1 half on each end); lay 2 tortillas in a single layer in the middle. In the following order, distribute 1/3 of each preparation or ingredient evenly over the tortillas: ricotta mixture (about 2/3 cup), corn (about ½ cup) and epazote (if using); splash on ¼ of the salsa (about 2/3 cup) and sprinkle on ¼ of the melting cheese (about ¾ cup). Make 2 more layers exactly the same, starting with 5 tortillas. Ingredients tend to dome in the middle, so take a moment to level out each layer before going on to the next. Lastly, cover the top with the 5 remaining tortillas (placed as in other layers) and evenly spread on the remaining salsa and sprinkle with the remaining cheese. Bake 30 minutes, until hot through and richly browned on top. Let stand for a few minutes before cutting into squares and serving.