Optimizing the regularization in size-consistent second-order Brillouin-Wigner perturbation theory.