You do not need a giant pantry, you need the right pantry. When we audited what was on the shelf in our test kitchen over a full year, the same 25 items kept showing up in 80 percent of our recipes. Build this list slowly over a few weeks, and you will be able to cook from almost any cuisine without a special grocery run.
The first ten are the bones: kosher salt, black peppercorns, all-purpose flour, sugar, olive oil, neutral oil, white wine vinegar, soy sauce, sherry vinegar, and dried pasta. Add to that ten flavor builders: garlic, yellow onions, lemons, anchovies, Parmigiano-Reggiano, butter, eggs, canned San Marzano tomatoes, dried chilies, and Dijon mustard. With those twenty alone you can make most of an Italian, French, or American repertoire.
The last five are what unlock global cooking: fish sauce, gochujang, tahini, garam masala, and dried shiitake mushrooms. Stock those and you can pivot from Roman to Bangkok in an afternoon. We keep all of these except the produce and dairy in glass jars on open shelving so we can see what is running low. Nothing slows down a Tuesday night dinner like discovering you are out of soy sauce mid-stir-fry.