The conclusion that buybacks are alternative for real investments is wrong.
The aggregate change between R&D and capex versus buybacks and dividends is not just some arbitrary decision. ROI from R&D and investments is slowing down for various reasons.
Instead of investing more without reason to do so, companies should give profits to owners or pay off excess debt.
There is wrong and right way to use buybacks. When company is not overvalued relative to its earnings, buyback is viable alternative for dividends. Taking debt to do buybacks or pay dividends is insane.