Unbiased contaminant removal for 3D galaxy power spectrum measurements