Preheat the oven to 225°F (about 107°C). Line a large baking sheet with parchment paper.
Halve the grape tomatoes and arrange them cut-side up on the prepared sheet. Add the unpeeled garlic cloves among the tomatoes. Drizzle with olive oil and sprinkle with salt and pepper.
Roast the tomatoes and garlic in the preheated oven for about 3 hours, until the tomatoes are concentrated and slightly shriveled.
Bring a large pot of salted water to a boil. Cook the orecchiette until al dente, about 8–10 minutes, then drain and reserve a small cup of pasta water.
While the pasta cooks, heat 1 tablespoon olive oil in a medium skillet over medium heat. If using roasted garlic, squeeze the soft garlic from the skins and chop if needed; otherwise use the 3 cloves of chopped fresh garlic. Add the garlic to the skillet and cook until fragrant, about 1 minute.
Add the slow-roasted tomatoes (and any juices) and the artichoke hearts to the skillet. Cook, stirring occasionally, for about 5 minutes to warm and combine the flavors. Add a splash of reserved pasta water if the sauce seems dry.
Stir in the chopped fresh basil and season the sauce with salt and pepper to taste.
Toss the drained orecchiette with the tomato–artichoke sauce in a large bowl. Serve topped with grated Parmesan cheese.