Similar protections have been applied already elsewhere in Tramp. Does
this solve the problem?

Best regards, Michael.