twisting it to the Romex and using two wire nuts (not recommended and not approved by code!)
Hardwiring is code-compliant, you just need to provide an appropriate junction box.
Using "two wire nuts", however, would be a code violation as it would leave one of the 3 conductors unconnected :)
Hardwiring individual components may not be ideally convenient, but it would seem appropriate for a power conditioning unit.