Costco Wholesale (COST -0.95%) is a retailer that has been resilient amid challenging economic conditions. Through both a pandemic and high inflation, the business has continued to grow and generate strong results. Over the past five years, the stock has risen 140%, eclipsing the S&P 500 and its 47% gains during that time frame.

The only problem with the stock is that it may look a bit expensive. Investors are paying a multiple of 40 times earnings for the stock, which is steep when you consider the S&P average is only 20. But while Costco's stock may look expensive right now, today's price could still be cheap given where the business might be in 10 years.

The company has plenty of room to grow

As of Sept. 3, Costco had 861 warehouses throughout the world. But the bulk of those, 591, are in the U.S. And if you include 107 that are in Canada and Mexico's tally of 40, that's 738 stores in North America, representing 86% of Costco's total store count. There is no shortage of opportunities for the company to expand in the future, particularly in international markets.

China, for example, is a promising opportunity for Costco. It has opened multiple locations there this year. And it was only in 2019 that it launched its first store in China, where more than 200,000 members signed up within just a few months.

The U.S. market is by no means tapped out

Although its largest presence by far is in the U.S., Costco isn't done growing in its home market. During the company's earnings call last month, Chief Financial Officer Richard Galanti said that over the next decade, Costco could "easily" add another 150 stores just in the U.S.

With only 591 stores in the country, that's approximately one Costco location for every 562,000 people in the country. And sometimes it can feel like that within the company's crowded stores. There's definitely plenty of room for Costco to expand just within the U.S. alone. And over the past decade, focusing on the domestic market has been enough for the company to achieve some impressive results.

COST Revenue (TTM) Chart

COST Revenue (TTM) data by YCharts

The company's strong financials give it the resources it needs to pursue more growth

Not only does Costco have many potential growth avenues to pursue, but it also has the resources necessary to do it. Over the trailing 12 months, the company accumulated $6.7 billion in free cash flow. Free cash flow is what the company has after accounting for its capital expenditures. And with its dividend costing it less than $1.3 billion on an annual basis, the company is generating plenty of excess cash that it can use to fund its long-term growth.

Between raising the price of its membership and growing into new and existing markets, there are plenty of levers that Costco can pull to help grow its top and bottom lines in the years ahead. That means that while its price-to-earnings multiple of 40 may appear high today, as its profits increase over the next decade the retail stock is likely to rise as well, even if investors pay a lower multiple for Costco in the future.

Should you buy Costco stock today?

If you're investing for the long haul, Costco is a stock that can make for an excellent investment to put in your portfolio. It can be a pillar that generates recurring dividend income (although its yield is modest at 0.7%) and provides stability along with the potential for capital appreciation in the future. This is a stock that can appeal to just about any type of investor. 

Costco isn't technically a cheap stock, but if you're waiting for it to fall to 15 or 20 times earnings, you could be waiting for a long time. Investors have shown a willingness to pay a premium for the business, and that's likely to remain the case for the foreseeable future given the incredible strength of Costco's fundamentals. While its shares might dip in the short term if its growth rate slows down, this remains an overwhelming buy for the long haul as the business is likely to get a whole lot bigger over the next 10-plus years.