If you have a Logitech mouse or trackball, you probably have additional buttons which you can configure. Here you'll learn how to quickly teleport your cursor by pressing such button.
You need to open Logi Options+ application. It allows you to get full potential of your Logitech device by configuring all additional buttons.
The example below is based on MX Master 3S for Mac.
Open the app, choose the right device and you'll see an image where you can select a button to configure. I've chosen the Wheel button.
Then you need to look for Open application action (you can use Search for that.) Now, you need to download Teleport application. It's only purpose is to perform teleporting action.
Now, move Teleport.app to
/Applications folder and then choose it by clicking Browse application in Logi Options+.
And that's it. Now, whenever you click the middle button (or any button you configure), you cursor will be teleported.