Methods for optimizing T cell immunotherapeutic effector and memory function