Manual:$wgDisableAnonTalk

Details
Disable links to talk pages of anonymous users (IPs) in listings on special pages like page history, Special:Recentchanges, 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 PersonalUrls hook to remove the link to the talk page of anonymous users: