Berkshire Hathaway owns a portfolio of dozens of stocks, worth about $334 billion as of mid-December. Many of these investments were selected by Berkshire's CEO and legendary investor Warren Buffett.

Like most investors, Berkshire's portfolio has many stocks that have performed poorly in 2022 as the market took a downward turn. But here are three, in particular, that look like incredible bargains as we head into 2023.

Buffett's newest bank stock investment

Berkshire accumulated a stake in Ally Financial (ALLY -0.43%) over the past couple of quarters, and now owns about 10% of the innovative bank. Ally is primarily an auto lender, which shouldn't be a surprise since it was formerly General Motors' (GM -0.10%) financing subsidiary.

In the years since the spinoff, Ally has evolved into a full-service online savings and loan platform. It offers a variety of loan types, a high-yield deposit platform, an investment and robo-advisory platform, credit cards, and more.

Ally has been beaten down in the 2022 downturn, with shares about 55% below their peak and trading for just over six times forward earnings on concerns that the lending industry is going to see defaults spike in a potential recession. But this is a highly profitable and well-run bank that should make it through any tough times and has tons of growth potential.

It could be a mistake to bet against this tech giant (AMZN 1.60%) has been a major underperformer this year, with shares nearly cut in half since the start of 2022. There are some legitimate fears, such as a potential cutback in consumer spending if we hit a recession, as well as profitability concerns.

However, it's important for investors to realize that, although Amazon is a dominant leader in both e-commerce and cloud infrastructure with its Amazon Web Services (AWS), it could still have a lot of room to grow.

For one thing, the bulk of Amazon's e-commerce business is domestic, and even in the U.S., e-commerce makes up less than 15% of all retail sales. On the AWS side -- the higher-margin revenue source -- the cloud infrastructure market is expected to grow by more than 300% by 2030. Even if Amazon can simply maintain its market share, this could be a big driver of profits. Plus, there are other industries that Amazon could potentially build a significant presence in, such as healthcare.

A sneaky play on EVs and autonomous-vehicle technology

Last but certainly not least, General Motors (GM -0.10%) is down by about 35% in 2022, and now trades for less than six times earnings. But GM could be one of the best plays on electric vehicles (EVs) and autonomous vehicles that's hiding in plain sight.

For one thing, GM is investing heavily in EV development, as well as its software and other newer businesses. It anticipates its majority-owned Cruise autonomous-vehicle business will generate $50 billion in annual revenue all by itself by the end of this decade. All in all, the company aims to double its revenue by then, compared with current levels.

It's worth mentioning that much of the growth is expected to come from higher-margin revenue sources (like software). In fact, management expects margins to reach 12%-14% by 2030, which would translate to profits in the ballpark of $40 billion annually, based on the company's revenue projections. For context, GM's entire market cap is just $56 billion, so if successful, GM could certainly be a multibagger for patient investors.

Look beyond 2023

One key takeaway from all of these is that all three investment theses are based on things that will take years to develop. While I believe that all three stocks could soar in 2023, that's not why I own them in my portfolio, and that's not why you may want to take a closer look. These are three great businesses with lots of growth potential that could deliver outsized returns to investors for many years to come.