Is there a special tool to remove the threaded portion of a shower head pipe that has broken off inside the wall?

Yes. You need a 1/2 inch Easy Out.