On Wednesday, the House passed an appropriations bill that included a provision both long past due and thought to be, in previous administrations, unnecessary. It bans any of the government agencies being funded by the bill from doing business with companies Donald Trump has retained ownership over during his presidency. Trump rebuffed the normal (ethical) expectations that he would divest himself of his business interests before assuming office so as not to create an immediate conflict of interest between his decisions as president and his own financial status; this would be a congressional attempt to come at the problem from the reverse direction.
If Trump is going to continue to rake in profits from his private businesses, then at the least we should bar the government agencies he controls from funneling cash to those businesses.
This is necessary because government agencies have in fact been funneling quite a bit of cash to Trump's properties, as have the Republican Party, conservative groups, lobbyist groups, corporate supplicants, foreign governments, and other interested parties. From the Secret Service's rental of golf carts (at steep prices) at Trump-owned clubs to Defense Department payments for Defense officials renting rooms at Mar-a-Lago, Trump's habit of frequenting his own for-profit businesses as president has all but obliged other government officials to frequent the same locations.
And Trump's companies don't go easy on those officials. Freedom of Information Act requests by NBC News revealed that the Secret Service was charged over $200,000 by the Trump International Hotel, blocks from the White House, during Trump's first year in office. The Secret Service spent over $33,000 in the two days surrounding Trump's first re-election fundraiser at the venue.
The Secret Service may be charged with defending the life and safety of the sitting president, but that president's company isn't above squeezing them hard while they do it.
A congressional insistence that federal agencies not put cash into the president's own pocket is therefore going to be considerably more complicated than it might first appear. Either Trump will have to stop charging taxpayers for the Secret Service agents, agency heads, and other federal workers obliged to follow him around on his numerous weekend golf trips, which will never ever happen; or they will be barred from showing up. That would be quite, to use the proper federal terminology for such things, a shitshow.
That said, it is extraordinarily unlikely that Senate Majority Leader Mitch McConnell will allow the provision to slip through. Period. Republicans have been near-unanimous in looking the other way as Trump makes money off of his elected office, and McConnell has not been shy in indicating that he intends to maintain that studious ignorance no matter what crookedness the opposing political party uncovers or seeks to bar.
At the moment, then, "What would happen if we passed a law preventing this one specific instance of presidential corruption?" remains a thought experiment. Actually putting a stop to it will require something more.