@vitor I contacted the maintainer of k2pdfopt and he told me how to disable the interactive mode. That was enough to, at the same time, passing the arguments to subprocess.Popen as an array and removing both the echo command and shell=True.
The only issue now is that double quotes are still an illegal character, but this is an issue with k2pdfopt that I already reported to him and he promised to look into.