What is the correct way to immediately stop an agent?

According to the docs if we do AIPath.SetPath(null) that will immediately stop the agent from moving, combine this with AIPath.destination = Vector3.positiveInfinity so it doesn’t re-path.

However this can throw a bunch of warnings if we do so while a path was still being calculated

Path Failed : Computation Time 0.00 ms Searched Nodes 0
Error: Canceled by script (Seeker.CancelCurrentPathRequest)

So what is the correct way to immediately stop an agent from moving? I’m assuming it’s not this because of the warning.

That error is perfectly ok and expected in this situation.
It indicates that the pending path calculation failed because it was cancelled. But since you explicitly want to clear the path, this is ok.