Heavy quark form factors at three loops in the planar limit