No, it is not. This is a common misconception that the large companies are very happy about.
1. The century-old Ford decision wasn't about this. It was about him refusing to pay dividends to shareholders he was feuding with. I.e. dominant shareholder using his control to starve minority shareholders of returns.
The court still let him keep spending huge sums on factories and price cuts that didn't clearly maximize profits.
2. Even if the case was about profit maximization (it wasn't), the judgment was a Michigan state decision. It doesn't have force outside of it.
3. US business law is in practice actually the opposite. A business can do pretty much whatever it wants. This is fundamental.
4. Even if it were illegal (it's not), anything can reasonably be framed as being in the long-term interest of the company, including donating to causes, raising employee wages and so on. Courts never question this.
Just imagine this was a thing. It's completely untenable for this reason. Who is a court to judge that something isn't in the longterm interest of shareholders unless it's literally spending all the company money on yachts for personal use?
5. No company has ever been prosecuted for this, obviously, because it's not a thing that exists. The closest you can get is that there's a potential duty to seek the best price if a company must be sold or broken up. But that's a very specific situation.
It's 100% a myth. Feel free to copy this and spread it when you see someone saying this.