Lots of stocks are arguably undervalued right now. Not every undervalued name, however, is necessarily a true "forever" holding. Perma-holdings still need to be companies that are timeless as well as malleable, adjusting as needed to an ever-changing environment.

With that as the backdrop, here's a closer look at three stocks that are not only bargains but picks you can feel good about tucking away for the long haul.

1. Merck remains a strong play in the pharmaceutical space

It's not a name needing much of an introduction. Merck (MRK 0.81%) is of course one of the world's biggest and best-known pharmaceutical outfits, with diabetes treatment Januvia, HPV vaccine Gardasil, and cancer-fighting Keytruda all part of its drug portfolio. You can step into the stock at a trailing price/earnings (P/E) ratio of only 16.7, while the forward-looking P/E ratio is an even more modest 13.3. That's about as cheap as this equity ever gets.

More curious is how the stock is still so cheap despite its strong, 32% run-up since the end of last year.

Pharmaceutical stocks aren't every investor's proverbial cup of tea and understandably so. It's a highly competitive market, and every drug's patent protection is relatively short-lived. All of these companies must continually refill their R&D pipelines, and they can only hope those projects evolve into revenue-bearing drugs. It's a risky business to be sure.

Much of that risk is mitigated, however, when you're talking about an outfit like Merck. Not only does it have a long history of picking the right acquisition prospects; its best-selling Keytruda was already in development by Schering-Plough when Merck acquired the company back in 2009. The pharma company also has deep pockets. Merck earned more than $15 billion last year; as of the end of September, it's sitting on more than $11 billion in cash. It's also not a stretch to suggest the company is more than creditworthy if and when it needs to borrow.

This sort of liquidity, paired with its R&D savvy, is a great answer to concerns that the company is too dependent on Keytruda, which accounts for about a third of Merck's top line.

The kicker: Merk's dividend yield currently stands at a solid 2.7%.

2. Goldman Sachs is primed for a comeback

There's no denying the Goldman Sachs (GS -1.72%) name doesn't quite turn heads the way it used to. Back in the market's heyday in the 90s and early 2000s, Goldman was the bank everyone wanted to work for and the outfit most companies looked to when it was time to go public or raise funds. Now, much of the luster is worn off.

Don't let the fact that Goldman isn't what it used to be distract you from what Goldman still is -- a rock-solid banking name with a diverse line of businesses ranging from investment banking to institutional trading services to wealth management, and more.

There is something of a catch. While Goldman Sachs is solid, its core businesses can be inconsistent. As an example, the company's underwriting revenue this year is down 67% compared to the first three quarters of last year. Even if 2021's phenomenally strong IPO and fundraising make for an unusually tough comparison this time around, it's a tough change to digest.

Take a step back and look at the bigger picture. These businesses are going to run hot and cold. But they're never going to go away.

Goldman Sachs shares are bouncing back from a steep sell-off suffered earlier this year. Even with the rally since last month's lows, the dividend yield of 2.6% and its forward-looking P/E ratio of 10.2 are enticing.

3. Broadcom will continue to make an impact

Finally, add Broadcom (AVGO -4.38%) to your list of bargain stocks you can buy today and hold forever. While you'd be stepping in at more than 20 times the stock's trailing and projected earnings, that's actually cheap by its historical standards.

Broadcom is a chipmaker, and as such, its stock has been ushered lower for the better part of this year as part of a sweeping sell-off of most semiconductor stocks. On the surface, the underlying worry makes sense.

This is an instance of when the market arguably should have been a bit more discriminating. The company is doing just fine despite broad industry headwinds. This fiscal year's top line is on pace to improve more than 20% following last year's revenue growth of 15%. Analysts expect this growth pace to cool to only 6% for fiscal 2023, but given the backdrop, that's pretty good; it may even be an unnecessarily tepid outlook.

The secret of this persistent progress isn't exactly a secret: It's Broadcom's focus. The company predominantly makes chips found in digital communication technologies like mobile phones, broadband receivers, and other consumer electronics. It also offers software that gets the most functionality out of its hardware.

Demand for these solutions isn't exactly the same from one year to the next, particularly if the economy is heating up or cooling off. However, the need for this sort of tech is rather resilient from one year to the next, since the world is effectively addicted to mobile phones and the web. That's never likely to change, making Broadcom a solid long-term bet.