btcd does no support this functionality by design, however you can use btcwallet which is written in golang and support what you want
here is a similar question https://github.com/btcsuite/btcd/issues/1308
A Bitcoin wallet that is online and connected in some way to the Internet is referred to as hot wallet.
That is why it is recommended to keep as much money as you would put in your pocket in a hot wallet.
How can i convert this (preferably using bash/Perl/python) into a WIF that can be imported into (preferably) Electrum?
OpenSSL .pem files contain base-64 encoding of the values encoded using DER. In case of private keys they use PKCS#8 explained in RFC5208. To extract the key itself, you first have to decode the base-64 string and get the key out by reading ...
Assuming the key is the posted compressed WIF KwDiBf89QgGbjEmUcXPRwPuKPFnFECvJkvovGNiyjaujMCrQXy98:
Decode the key you have using the encoder used (in this case base-58)
Remove the extra bytes (version byte, compressed byte if present, checksum)