Remove all husks and silks from the corn. Pat dry and rub lightly with oil.
In a small saucepan over low heat, melt butter. Add garlic and cook 1 to 2 minutes until fragrant but not browned. Remove from heat. Stir in parsley, cilantro if using, lime juice, salt, and pepper. Keep warm.
Preheat grill or grill pan to medium-high heat. Oil the grates lightly.
Grill corn for 10 to 12 minutes, turning every 2 to 3 minutes, until charred and caramelized on multiple sides.
In the last 2 minutes of grilling, brush garlic herb butter generously over the corn twice, turning between each basting.
Transfer to a serving platter. Brush with any remaining butter. Scatter chili flakes and flaky sea salt over each cob. Add crumbled cheese if using and extra fresh herbs. Serve immediately with lime wedges.
Notes
Remove all corn silk before grilling — it burns bitter on a hot grill
Rub the corn itself with oil as well as the grill grates for even charring
Turn every 2 to 3 minutes for even caramelization on all sides
Baste with garlic butter in the last 2 minutes only to prevent the garlic from burning
Serve immediately — grilled corn is at its best the moment it comes off the grill
Make extra garlic butter and refrigerate it for up to 3 days for other uses
Aleppo pepper instead of chili flakes gives a gentler, fruitier heat
For Mexican street corn, add a spread of mayonnaise and crumbled cotija after grilling
For indoor cooking, use a cast-iron grill pan over high heat with the extractor fan on
Garlic butter can be made up to 3 days ahead and refrigerated — rewarm before basting