Ball pythons curl into knots like that. He was hiding his head and neck as a defensive thing. Coiling into a pile would mean he was sleeping or ready to strike. They're called Ball Pythons because when they ball up they can be rolled around like a ball.
shouldn't they curl more pile(?) like?