My understanding is that Congress has used SS for a slush fund for years instead of investing the money.
That is somewhat of a distortion. The original SS law provided that any surplus in the SS trust fund would be placed in special treasuries and earn interest. It was basically a pay-as-you-go system with no surplus revenues. In the 1980's government realized when the baby boomers began retiring (2010-2030) SS benefits would exceed revenues and raised SS contributions to 6.2%.
Over the years it accumulated a $2.7 trillion surplus. The money was both invested (treasuries drawing interest) and borrowed since money that buy treasuries is used for general operations. The alternative would be for the government to borrow the money by selling treasuries on the open market and the trillions in surplus funds sitting there drawing no interest.
SS benefits now exceed revenues and the treasuries in the trust fund are being redeemed to cover the difference. That redemption requires more borrowing to pay the treasuries. It is part of the intergovernmental debt rather than the public debt. Congress cannot borrow from SS revenue since there is no surplus to borrow.
By about 2035 the surplus will be depleted and revenues will only cover about 70% of benefits.
So, nobody did anything improper or cause problems with SS benefits by borrowing the money. The main problems were caused by a decline in the birth rate (fewer workers per retiree), longer life span, and Congress being too generous by continuing to add new benefits and beneficiaries (spouses, widows and orphans, cost-of-living increases, early retirement at 62, etc.).
It is no different than the other $30 trillion government borrowed through selling bonds, bills, notes.