I thought you couldn't maximize for more than one variable, and so if society wants other outcomes such as low pollution laws need to tie high fines to it.
Which Hayek was fine with (as shown in The Road To Serfdom).
https://www.dailykos.com/stories/2013/09/27/1241729/-The-Roa...
I don't know if I buy the whole social program thing, but the quote is correct. Reader's Digest: https://mises-media.s3.amazonaws.com/Road%20to%20serfdom.pdf
The costs approach effectively allows a firm to optimise for profits, but changes the weightings of various activities and products or inputs.