Autism and head-butting/head swinging

My 3 year old son that is on the spectrum keeps using his head as a weapon. Not so much to be mean, he will be playing and happy, but will randomly head butt the shit out of you. He head butt me in the kidney this morning and it hurts horribly. He also head butts his 1 year old brother and swings and shakes his head around sometimes banging it into things. When he’s overstimulated sometimes he will shake and swing his head around so fast I’m afraid he’s going to hurt his neck. He has bruises and bumps all over his head because he won’t stop swinging it around and he bangs it on the wall or furniture.

Has anyone dealt with this? How can I get him to stop?