Preheat the oven to 375 degrees.
Char the poblanos until blackened on all sides. You can do this over a gas stove top, on the grill or under the broiler. Place the blackened peppers in a bowl, cover, and set aside to cool.
Heat the oil in a medium saucepan over medium heat. Add the onions and half of the salt, then cook until the onions are translucent, about 5 minutes.
Add the rice and stir until coated with oil, then add the chicken stock or water. Bring it up to a boil, then reduce the heat to low and cover. Simmer for 10 minutes or until the rice is cooked through.
While the rice cooks, remove the blackened skins from the cooled poblanos, then use a knife to scrape out the seeds. Don't rinse under water or it will wash off all the charred flavor. Finely chop the peppers.
When the rice is cooked, remove the lid and add the poblanos, the remaining salt, corn, sour cream, ¾ of the cheese and half of the scallions, then stir to combine.
Transfer to a medium casserole dish (9x9, 6x10, or similar) and spread out evenly. Top with the remaining cheese and bake for 30 minutes or until bubbly and browned around the edges.
Let cool for at least 10 minutes before serving. Top with remaining scallions and cilantro if desired.