The simplest way to get a drowning person off you is to go down. With your arms at your sides, push up, like the reverse of when you're trying to lunge out of the water. As soon as the drowning person's head goes below water they will let go and you can come back for another attempt.
Don't punch them, it's less effective and can knock them unconscious, which can complicate the rescue.
Source: was a trained and certified lifeguard and swim teacher in my teens.