If you're concerned about untrusted input, it's better to avoid using os.system, since that invokes the shell, and in general, you don't want the shell anywhere near untrusted input. In addition, you typically want to avoid putting secrets into command-line arguments since they can be read by other users, although since echo is usually a built-in, this isn't strictly a concern here.
To do this securely, you can use subprocess.Popen instead, like so:
import subprocess
proc = subprocess.Popen(['chpasswd'], stdin=subprocess.PIPE)
proc.stdin.write(b"username:password")
Note that if you need to pass additional arguments to chpasswd, you'd do that by adding arguments to the array:
proc = subprocess.Popen(['chpasswd', '-c', 'SHA512'], stdin=subprocess.PIPE)