Bitcoin miners are the ones that use the energy calculating the SHA256 functional. The cost of the function is not relevant to energy use as competition between miners means the energy used will match the value of the block reward.
This optimizing is for the users of the bitcoin network that must validate that the rules are being followed so they can reject any miners that do not follow the consensus rules
This optimizing is for the users of the bitcoin network that must validate that the rules are being followed so they can reject any miners that do not follow the consensus rules