Is there a way to manually mute certain speakers in a situation with a defective headphone plug in where sound comes out of both headphones and built in laptop speakers?

Nope - if your sound is coming from both the headphones and the built-in speakers, it's your headphone socket in the laptop - not the plug that's at fault ! Basically an audio socket is a switch. While no external speakers (ie headphones) are connected, its internal components direct the sound to the computer's built-in speakers. Inserting a plug into the socket breaks the connection to the internal speaker circuitry, and directs the sound to the headphones.