I just realized that Harry can’t speak English when he’s around a living snake so he was probably screaming in parsletongue during that whole exchange and both the snake and Tom understood it so the narration didn’t give that detail away.
He switched back to English when the snake had died, which is why Ginny could understand him.
I’m sorry, but I’m freaking out about this.