Costco (COST 1.01%) has been an unusually positive force in shareholders' portfolios. The retailer outperformed peers in its brutally competitive industry this past decade, delivering market share growth and steady earnings through a wide range of selling environments. Costco has also sent billions to investors through regular and "special" dividend payments, including the most recent $7 billion windfall that arrived in mid-January.

You might think these factors all limit your potential returns from buying this stock right now. Shares outperformed the S&P 500's rally by a wide margin last year, after all, to push Costco's valuation to a new high. So let's look at whether the stock might still be a bargain for 2024 and beyond.

Shopper engagement

Costco's brand loyalty is one fantastic reason to remain optimistic about the stock today. A retailer that can keep its shoppers happy won't struggle to grow sales over time. The warehouse business is excelling in this department, and investors can see evidence of those wins in several key metrics.

Consider comparable-store sales growth, which accelerated in December to nearly twice the rate that investors saw in the previous full quarter. That means Costco likely gained more market share over the critical holiday shopping season. Its renewal rate is sitting at a record high of 93%, meaning members are happily frequenting its stores through inflation spikes. Finally, there's Costco's 4% customer traffic boost this past quarter that stacks up well against other national retailers like Target.

Deceptively strong earnings

Costco's finances are a lot stronger than they might first appear. Sure, its 3% profit margin sits below nearly all its peers, including Walmart and Target. Yet that profitability isn't volatile at all. In contrast, you can see Target's profit margins swing along with shifting consumer spending patterns during and following the pandemic.

COST Operating Margin (TTM) Chart

COST Operating Margin (TTM) data by YCharts

Costco doesn't put its shareholders through that volatility because it isn't really a retailer. Most of its earnings come from membership fees, making it more of a subscription club business. It's a powerful selling approach because it allows Costco to charge very low prices while generating steady earnings through those inevitable market upturns and downturns.

Add in the company's strong cash flow, which has funded over $10 billion in special dividend payments since 2020, and you've got some good reasons to believe Costco can easily extend its positive momentum into 2024.

Price is a challenge

The biggest risk for investors is paying too high of a price for this successful consumer staples business. That's a clear danger here given that Costco is valued at 1.2 times annual sales, a new high for this retailer. You could own Target or Walmart for about half of that premium.

Costco shares don't tend to be offered at a big discount, making it less likely that a market downturn will generate a much better price for the stock. Still, it might be worth watching shares rather than purchasing following the stock's big rally in 2023. You could also consider buying Costco stock in thirds, which would lessen the risk of establishing a big position right before the stock declines in value.

In either case, Costco is likely to deliver good returns to patient shareholders. But those gains should be limited by its pricey valuation.