This will usually make it more sedate. Use any weapon you have, or your fist. Alligators often open their mouths when tapped lightly. They may drop whatever they have taken hold of, and back off. Try to keep the mouth clamped shut so the alligator does not begin shaking.
Alligators have a huge number of pathogens in their mouths.
Of course, avoiding the attack is preferred. Vanweerd said he obeyed this. He said he didn't see any signs warning him of the infested waters. I bet there is now. I bet money there is.