Preheat oven to 350°F.
Melt butter in a skillet over medium heat. Add corn and cook for about 5 minutes, allowing it to lightly char.
Stir in diced onion (and jalapeños, if using) and cook for another 2 minutes, until fragrant and softened.
Season with garlic powder, chili powder, salt, Tajín, and a squeeze of lime juice.
Lower heat and mix in sour cream, cream cheese, and mayonnaise. Stir until smooth and fully combined.
Transfer the corn mixture to a baking dish and spread evenly.
Top with shredded cheese.
Bake for 15 minutes, then broil for 1–2 minutes until bubbly and lightly golden.
Finish with extra Tajín, cotija cheese, chopped cilantro, and sliced jalapeños.