Yes - understood.
However, you need to determine on your system if there is the software equivalent (some string of commands) that will have the same end results as pushing a mouse button.
E.g. some screen icon that when clicked allows you to talk in Discord. So you would skip the graphics part (the icon) and just have the necessary audio related commands sent.
To do that you need to know the string, you need to know if the mouse (button 3) is programmable so when button 3 is pressed the string is sent.
Plus some logic within the "program" that looks at the current audio talk state (on or off) and reverses the state with the button click.
Python/ pyaudio might work. "Might" (full disclosure) because I have just started tinkering with Python and do not have enough knowledge or experience per se to be sure.
Link:
https://www.raspberrypi.org/forums/viewtopic.php?t=157013
Seems to be Linux options as well:
https://askubuntu.com/questions/12100/command-to-mute-and-unmute-a-microphone
The following link may be more useful:
https://ubuntuforums.org/showthread.php?t=2342661
The make and model of your mouse is important. The mouse needs software somewhere that detects the button being pressed (button 3 in your case) and then sends the appropriate "push to talk" commands. And monitors the button so that when the button is released the microphone is muted.
And here is a Chrome related link:
https://superuser.com/questions/296740/disable-mouse-hotkeys-in-chrome
Scripts:
https://autohotkey.com/board/topic/93207-help-me-with-a-scriptmute-and-unmute-microphone/