The usage of the commands is incorrect.
- driver.close() or browser.close() will only terminate the currenly running instance of chrome.
- driver.quit() or browser.quit() will terminate all of the open windows, then exit webdriver.
But if your still left with closed ports on your system which you want to make use of...then I recomend writing a code similar to what I do at my workplace. I've written the code in C# and not in Python.....You can probably write an equivalent of this..
Process[] chromeDriverProcesses = Process.GetProcessesByName("chromedriver");
foreach(var chromeDriverProcess in chromeDriverProcesses)
{
chromeDriverProcess.Kill();
}