Manual:$wgDisableAnonTalk/en

Details
Disable links to talk pages of anonymous users (IPs) in listings on special pages like page history, recent changes, etc.

This does not disable the talk page itself, nor does it remove the "mytalk" link anonymous visitors see on top of every page. For that, use the $1 hook to remove the link to the talk page of anonymous users: