In Harry Potter and the Chamber of Secrets, the trio sees Professor Sprout carrying bandages and Harry also notices the Whomping Willow's branches in slings. We also know from future books that the tree has a specific knot that needs to be pressed by someone small and limber (Pettigrew in his rat form/Crookshanks) to paralyse the tree. So, how did Sprout manage to paralyse the tree long enough to bandage it?
I am not aware of a canonical answer, but based on what we see in the books, the above charm seems a good candidate.
Ron needed to get under the tree in Deathly Hallows, and like the OP, his first thought was he could do with a small, intelligent animal to press the knot for him. Hermione helped him by paraphrasing a question he'd asked her years before: "Are you a wizard, or what?" Ron then used a Hover Charm to make a stick touch the knot and stop the tree moving.
As a herbologist, Sprout might well have been aware of other ways to tame a Whomping Willow, but she almost certainly also knew about the knot on this specific tree. The Hover Charm is basic magic, and would probably be the easiest way for her to make the tree manageable.
We learn in Harry Potter: Hogwarts Mysteries that a judiciously applied freezing charm will prevent a young Whomping Willow from attacking while you bandage it.
I think we can assume that a powerful and experienced wizard can cast a sufficiently powerful charm as to temporarily disable even an adult willow.