Although the near-term outlook of the stock market may not be positive, it's giving long-term investors opportunities to purchase some stocks at great prices for stashing away in a portfolio. If you think of the problems investors were dealing with three, five, or even 10 years ago, many of those investing concerns are no longer relevant just a few years after they dominated headlines.

As a result, investors shouldn't be as focused on short-term fears and should consider scooping up these two stocks as long-term buy and holds.

1. Taiwan Semiconductor

Taiwan Semiconductor Manufacturing (TSM 1.26%) is the largest contract chip manufacturer in the world. It's also seen as the technological leader in this space, as it has developed market-leading 5 nanometer (nm) and 7 nm chips, as well as pioneering 3 nm chip technology. The bottom line is that if you want the best chips, go to Taiwan Semiconductor.

And that's what top companies like Apple, Nvidia, and Advanced Micro Devices have done, as their devices utilize TSMC's products. So regardless of how popular artificial intelligence (AI) becomes, Taiwan Semiconductor's chips will always find uses in nearly every facet of our digital-first society.

This makes the long-term tailwinds of Taiwan Semiconductor quite favorable, even if the company is experiencing a short-term revenue decline thanks to falling demand for consumer products like laptops (Taiwan Semiconductor's revenue fell 14% in the second quarter). However, thanks to this short-term pessimism, investors can scoop up Taiwan Semiconductor shares at an attractive valuation of 15 times trailing earnings.

TSM PE Ratio Chart

TSM PE Ratio data by YCharts

With that attractive price tag plus the long-term tailwinds of high technology, Taiwan Semiconductor is a no-brainer buy at these prices.

2. Upstart

Upstart's (UPST 2.76%) stock knows how to take its shareholders on a roller-coaster ride. The company has undergone multiple phases of rapid stock price growth, followed by subsequent crashes. In 2023 alone, Upstart's stock was up more than 400% before losing half of its value in the past couple of weeks.

With these kinds of aggressive movements, why are there still investors? It has to do with how impressive the product is. Upstart's product is an alternative to the traditional FICO credit score. It uses additional factors like education level, bank account balances, and employment history to judge a borrower's likelihood of default.

While this product is only available with personal and auto loans, it shows great promise. Upstart's clients can approve the same amount of loans with 53% fewer defaults -- a massive profit boost for the business. Additionally, its model provides 5 times more risk separation than a FICO score, making it more evident when a borrower could be a lending risk.

Upstart's approach makes a lot of sense and works well, but its problem is the macroeconomic environment. Because interest rates are high, demand for loans is weak. As a result, Upstart's business is substantially lower than last year's. In Q2, Upstart originated 109,000 loans, down from 321,000 last year.

This translates into less revenue for the company, as evidenced by its 40% year-over-year drop. While AI investors piled into this stock throughout the year, they weren't prepared for these results, and the stock dropped like a rock after earnings.

However, that's the wrong mindset for owning Upstart's stock, as it won't see a true business recovery until interest rates are cut, and all of the personal and auto loans taken out at dirt cheap rates in 2020 and 2021 are repaid.

Upstart's business will see a sizable boost when those two catalysts occur throughout the next few years. But until then, investors will need to ignore the short-term movements of the stock. Thanks to the recent drop, you can pick up shares at just 5 times sales, a bargain for a stock with incredible technology like Upstart.