The easy workaround is to disable it completely, with mapping it to a nonexistent button with xmodmap.
xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9 10"
this maps the middle button to button 25 (you can give any number instead of 25 as long as it’s higher than the allocated number of your mouse buttons, which usually goes up to 10-14)
Then add this line as a startup command in Startup Applications.
$ xmodmap -pp
There are 12 pointer buttons defined.
Physical Button
Button Code
1 1
2 25
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12