Restaurants often prepare baked potatoes in a tight foil wrapper, and supermarkets often sell potatoes pre-wrapped for baking. It's a convenient way to prepare the potatoes, because the foil retains heat and keeps the potatoes at serving temperature for longer. Unfortunately, foil-wrapping potatoes poses a couple of hazards, and it isn't necessarily your best option from the culinary perspective.
The most significant hazard of baking your potatoes in foil is the risk of botulism. Botulism is caused by a pathogen called Clostridium botulinum, which occurs naturally in the soil. It's an anaerobic bacteria, which means it grows and produces its powerful toxin when it is in an airtight environment. If you wrap potatoes in foil and bake them at a high temperature, this creates the potential for the bacteria to flourish. In 1994, foil-wrapped potatoes proved to be the cause of a botulism outbreak in a Texas restaurant that sent 30 people to the hospital.
Foil's ability to retain heat inside the potato is a boon when you need to keep potatoes warm for an extended period, but it also has a down side. If you take the potatoes straight from the oven to a plate or serving platter, they can be hot enough to cause a painful burn. The steam from an overheated potato can also pose a hazard, if a diner cuts into it as soon as it is served.
Baking potatoes in foil also has its drawbacks. The wrapped potato steams in its own moisture rather than truly baking, which has a number of effects. The skins remain thin and soft, rather than becoming crisp, like the skin does with unwrapped potatoes. Some diners prefer a soft skin, so that's not necessarily a problem, but wrapped potatoes also have a less appealing flavor and texture. The flesh of unwrapped potatoes dries during cooking, concentrating its earthy, buttery and savory flavors. It's also drier and fluffier, making it a better vehicle for butter and other popular toppings such as sour cream and chives.
To enjoy the best baked potatoes, choose a "floury" variety such as a Russet Burbank rather than a "waxy" variety such as Yukon Gold. Pierce the skin in several places with a skewer, so steam can escape. If you like an especially crisp skin, rub the potato lightly with olive or vegetable oil. A sprinkling of coarse salt also helps make the skins more savory. Bake your potatoes directly on the oven rack at 375 degrees Fahrenheit or higher, until they are tender all the way through. If you have an instant-read thermometer, the ideal internal temperature is 200 F to 210 F when they are fully cooked.