osslsigncode -pass places the key passphrase in the process arguments, so ps can read it.
So instead, pipe it to -readpass -, which reads it from stdin (osslsigncode 2.9+, the Guix codesign manifest uses 2.14). Since printf is a shell builtin, the passphrase does not appear in any process arguments.
Only sh -n was used to verify, not actual signing keys. This focuses on the Windows part of #36651.