A fascinating U.S. case on this subject, from 1806, is Thorne v. White (D. Pa. 23 F. Cas. 1132). The opinion, by Judge Hopkinson, contains much more in the way of instructive material than I could possibly quote here. As in many other cases brought by seamen, the issue was wages -- specifically, whether the bad conduct of the seaman bringing the case entitled the owners to withhold his pay for the voyage. This gave Judge Hopkinson the opportunity to discuss at length how the behavior of sailors and captains must be weighed to determine who was most at fault.
It is the duty of seamen to bear even the ill-temper of the master, and to get out of his way, when instances of passion occur. ... Some of the maritime laws are particular in adjusting how a mariner shall demand [sic] himself when the master is enraged, and when he may stand on his defense. A master must not pursue (as was done in the case before me) a mariner, who flies from him when enraged. ... When the crime of a sailor is too great for the master's authority to punish (which should be evident on the trial, to justify severe measures) the master and his officers are to seize the criminal, put him in irons, and not take the law into their own hands, but bring him to justice on their return. But the contract for wages is not affected. ...
I have generally thought myself warranted to give a latitude of construction to the words "moderate correction," where chastisement was salutary and merited, and in this I have never been overnice. The safety of a ship sometimes depends on promptly checking disobedience, and stimulating exertion. Subordination is peculiarly essential to be enforced, among a class of men whose manners and habits partake of the attributes of the element, on which they are employed. ... [But] instances have not been rare in this court (and they have not been overlooked) where the most enormously cruel, and unjustifiable acts of tyranny, and wanton abuses of power, have been exhibited by masters of ships. ... The sea laws enjoin on the master a temperate demeanor, and orderly and decent conduct, towards seamen. By several of these laws, he is finable for abusive expressions[!], or misconduct, towards mariners. ... When a mariner is incorrigibly disobedient, and will not submit, and offer to do duty and make amends, the master may discharge him. He may correct and confine him on board the ship, or dock him of his provisions.
There is much more worth reading, but I fear I have already tried the reader's patience. One footnote, however, needs to be quoted in full, because in it the judge describes an earlier case that bears some similarity to the Town-Ho's story:
In a case wherein confinement on board the ship, of two disobedient seamen, appeared to me proper, and indispensable, and where frequent endeavors to reclaim were ineffectually tried, for almost the whole latter section of the return voyage, I held the confinement in irons, so justifiable and necessary for the safety of the ship, that I refused to allow wages for that part of the voyage. The two seamen were influential characters, and atrocious leaders of a rebellious crew. [As] they had not misbehaved on the former part of the voyage, I considered it to be a partial breach of contract, and not a forfeiture in toto. These seamen complained, I thought without cause, of high-handed and cruel treatment. I left them to their remedy at common law, by action for false imprisonment, or any other mode of redress.Ishmael's Rights, Part I
Ishmael's Rights, Part II