What the restaurant would need to do is ask you to pay up front with visa, or to provide your visa prior to ordering so that they could charge you. That would solve the problem if they charged you before you ate the meal, but if they try to charge your visa after the meal and the charge is declined, you can still settle with cash.
But somehow, with the tax avoidance issues with tips, they would either not do this or ask for the tip in cash.
Can you really "always settle a debt with cash"? Even if you are told beforehand that the deal isn't for cash? Would this mean that I am effectively forced to accept cash for rendering goods or services?
It is, up until the point you turn it into a debt. This means you can require trading apples in return for potatoes, but you have to do the transaction up-front. So if you ran a food stand and rejected any cash transactions at the point of sale, you are completely within the law.
You could not give your apples to your neighbor in the spring, and force them to settle up via potatoes in the fall. If they wanted to, they could pay you the equivalent of their potato debt in cash.
And yes, if someone ends up owing you money and offers you cash to settle - you must accept it, with very few exceptions. All debts public and private actually does have some serious teeth after all.
A long time ago I had to settle a bet on this topic, and it was more extensive than this. The tldr; is that at no time in US history have you been forced to take US currency, with the exception of debts.
It actually does make sense. What happens in the event your neighbors potato harvest fails and they get out of the business? If you sued them in court, the court would award you the market value of the replacement cost of the potatoes you did not receive (most likely). And thus they would be settling up via cash either way.
You'd need to have your contract signed and agreed upon prior to rendering services or goods.
(n) coins or banknotes that must be accepted if offered in payment of a debt.
Debt != barter
A potential workaround would be if the menu's prices were not in dollars, but instead in credit card points or some such nonsense, but even this is probably arguable.