The function was getting a bit convoluted to follow, and there was a maintenance burden of having to remember that "shell=True" should only be true if the argument is a single string to be passed exactly as-is to the shell. If it's a list, only the first value in the list would be ran as the shell command and the rest would be given as arguments to the shell itself.
Therefore, it's been refactored to automatically determine shell-mode based on whether "args" is a list or a string.
On Windows, we now generate a correctly escaped shell-string via "shlex". This ensures that we properly support spaces inside quoted launch arguments, by auto-escaping them on a per-argument basis.
The extra pylint hint is needed because the import is detected as unused on non-Windows machines.