Modify to capture errors:
$process = new Process(['python3', base_path('login_script.py')]);
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
return $process->getOutput() . $process->getErrorOutput();