Cut the stems out of the tomatoes, using your knife to remove most of the white core. Slice the tops from the jalapeños or serrano chiles. If you want a milder salsa, you can slice the chiles in half and remove the seeds and ribs. For a medium level of heat, remove just some of the seeds and ribs.
If you want to grill the vegetables, preheat a grill to medium and place the tomatoes, peppers, onions (if using), and garlic on a large piece of foil, pull up the edges of the foil to prevent them from spilling off the sides, and grill for about 30 minutes, turning the vegetables as needed so that they get browned in spots on all sides.
If you want to roast the vegetables in an oven, preheat the oven to 375 F. Place a piece of foil on a baking sheet, place the tomatoes, peppers, onions, and garlic on the foil, and loosely close the foil over the top. Bake for about 1 hour until the vegetables are soft and a bit browned.
Transfer the vegetables and any juices that have accumulated in the foil to a food processor or blender. Add the cilantro, oregano (if using), lime juice, salt, and pepper (if using). Pulse or puree, depending on how chunky you want the salsa to be. Taste and adjust the seasonings as needed.
Notes
I have made this with and without onions, and it's great either way. You can adjust the amount of heat in the salsa by choosing peppers with varying heat levels, adjusting the amount of hot peppers you use, and deciding the amount of hot pepper seeds you include. Most of the heat in a hot pepper resides in the seeds and the veins (the strings inside that hold the seeds together).
Try adding some tomatillos to the roasted veggie mix. Remove the papery husks, and then roast a few tomatillos with the tomatoes for a layer of slightly tart acidic flavor in the salsa.
Store the salsa in an airtight container in the refrigerator for up to 5 days.