The legislation, requested by the White House, would codify spending cuts pursued by Elon Musk’s Department of Government Efficiency.