It would be strange that not removing trademarked phrases in function and class names would be a trademark violation when forking a project. Which I assume are covered by the GPL as well. Same goes for comments etc. I would guess most trademark registrations doesn't cover usage in code.

Also I know WP developers issues DMCA notices to web hosts that host some site that distribute their stuff even if its was perfectly fine for the site to do so. Since most web hosts dont know much about DMCA and WordPress anyway (explanation given in the WordPress presentation). So essentially the practice that people condemn game, music and movie for practicing seems to be perfectly acceptable within the WP community.