My DD is slowly growing out of this.
One thing I found worked well was to hold her hand and gently stroke my hair. She genuinely loves the feel of it and her face lights up.
Yesterday she did gently stroke my hair instead of pull it when she found the opportunity.
It was a sweet moment.
I'd say a quick 'no, that hurts!' and putting your son down facing away from you says it all, that or the stroking. I found that at first helping DD stroke made her frustrated so I just waited it out (while putting her facing away from me) until she was open to help.