Investing probably never entered Robert Frost's mind when he composed his famous poem "The Road Not Taken." However, one of his key points -- taking paths that most people don't can often be highly rewarding -- certainly applies to investing.

Contrarian investing is based on this principle. Buying shares of companies that many others don't view positively can pay off big-time in some cases. I think there are several contrarian plays that especially stand out right now. Here are three stocks going against the grain of conventional wisdom that could deliver huge gains for long-term investors.

1. Occidental Petroleum

You've no doubt heard the predictions that fossil fuels are going the way of the dinosaurs. Renewable energy will replace oil and gas over the coming years if this take is correct. That would seem to make stocks like Occidental Petroleum (OXY -0.15%) poor choices for long-term investors.

So why is Warren Buffett buying shares of Occidental hand over fist? Is he making an uncharacteristic blunder? I don't think so. Instead, I suspect that Buffett recognizes a reality that many investors don't: Global demand for oil and gas is likely to rise rather than decline over the next few decades.

Occidental's valuation doesn't reflect much optimism about the future. Its shares trade at under 11.6 times expected earnings. By comparison, the S&P 500's forward earnings multiple is nearly 20.7.

Vicki Hollub, Occidental's CEO, predicts that there will be a global shortage of oil by the end of 2025. Hollub is leading her company to invest in increasing its oil and gas production. For example, Occidental announced in December its plan to acquire CrownRock for $12 billion to boost its U.S. onshore portfolio.

The company is also making a big bet that just might be a game changer. Occidental continues to lead the charge in developing direct air capture technology that can suck carbon dioxide out of the atmosphere. If this effort proves to be successful, Occidental should be a massive winner for investors over the long term.

2. PayPal Holdings

PayPal Holdings (PYPL 2.90%) has been left in the dust in the fintech market, according to one school of thought. The advent of Apple Pay and similar products has largely made PayPal irrelevant based on this view. Proponents of the theory might point to the fact that PayPal's share price has plunged more than 80% from its 2021 peak as evidence that they're right.

For a supposed has-been, though, PayPal's business looks surprisingly strong. The company's revenue jumped 9% year over year in the fourth quarter of 2023 to $8 billion. Its adjusted earnings per share soared 19%. PayPal finished 2023 with a cash stockpile of $17.3 billion compared to debt of $11.3 billion.

The company is focusing on increasing the use of Venmo debit cards, which generate 6 times more revenue than peer-to-peer Venmo customers. It's promoting PayPal Rewards, a program that incentivizes higher engagement and drives greater average revenue per account. PayPal is also beefing up its products for small and medium-size businesses. These initiatives could pay off nicely over the next few years.

In the meantime, PayPal stock is dirt cheap, with shares trading for less than 11.5 times forward earnings. Wall Street projects that the company will be able to increase its earnings by nearly 20% annually on average over the next five years. This level of growth makes PayPal's valuation look even more attractive.

3. Pfizer

There are several seemingly rock-solid reasons for investors to avoid Pfizer (PFE 0.55%). The big drugmaker's revenue and profits are sinking (along with its share price). Fewer people are choosing to use Pfizer's COVID-19 vaccine Comirnaty and oral antiviral pill Paxlovid. The company also faces the loss of exclusivity for multiple top-selling products over the next few years.

All of those are admittedly serious concerns for Pfizer. However, they should be taken in context with some other, much better news for the big pharma company.

For example, Pfizer's pipeline has been exceptionally productive. The company expects around $20 billion in additional annual revenue from new products and new indications for existing products by 2030. That's more than enough to offset the anticipated revenue impact from drugs losing exclusivity.

Pfizer projects another $25 billion in additional annual revenue by 2030 from new business development deals. The company has already completed several acquisitions recently, notably including the buyout of Seagen.

It's also possible that 2024 could be a trough year for Pfizer's COVID-19 revenue. Management expects a potential sales boost from the combination COVID-flu vaccine that it hopes to bring to market in the not-too-distant future.

Pfizer's dividend yield of 6% means that the stock doesn't have to do much to still deliver a decent total return. I think, though, that as the company's new products and the results from its acquisitions begin to bear fruit, more investors will recognize that Pfizer's story is better than they thought.