Preheat the oven to 375ºF. Peel the sweet potatoes and cut into bite-sized chunks. Place in a 9×13-inch glass baking dish. Add shallots and garlic to baking dish and drizzle with 2 to 3 tablespoons of olive oil. Toss gently with a wooden spoon to avoid breaking up shallots. Season generously with salt and pepper, then sprinkle with cayenne pepper. Toss gently again to spread seasonings more or less evenly.
Place baking dish on middle rack in oven and roast 40 to 55 minutes, stirring gently a couple of times during the roasting, until sweet potatoes are tender and slightly browned.
The sweet potatoes may absorb a bit of the olive oil and appear to be drying out—just drizzle with some more oil before tossing them. The shallots may brown even more than the sweet potatoes, and the chopped garlic will almost certainly blacken. That’s okay—all will be delicious. If your sweet potatoes were refrigerated before roasting, as mine were, you will probably need the full 55 minutes. Transfer to a serving bowl and serve immediately.