Many laws that restrict freedoms are effectively substitutes for private contracts. In a frictionless world we wouldn’t need those laws because every subset of individuals could sign private contracts to decide efficiently what the laws decide bluntly and uniformly. But given transaction costs and bargaining inefficiencies those blunt laws are the best we can do.
Some people might want to sign contracts that constrain themselves. For example I might know that I am tempted to drink too many Big Gulps and I might want to contract with every potential supplier of large sugary drinks, getting them to agree never to sell them to me even if I ask for it. But this kind of contract is plagued not only by the transaction costs and bargaining inefficiencies that justify many existing planks in the social contract, but in addition a new friction: these contracts are simply not enforceable.
Because even with such a contract in place, when I actually am tempted to buy a Slurpee, it will be in the interest of both me and my Slurpee supplier to nullify the contract. (It doesn’t solve the problem to structure the contract so that I have to pay 7-11 if I buy a Slurpee from them. If that contract works then I don’t buy the Slurpee and 7-11 would be willing to agree to sign a second contract that nullifies the first one in order to sell me a Slurpee.)
These considerations alone don’t imply that it would be socially efficient to substitute a blanket ban on large sugary drinks for the unenforceable contracts. But what they do imply is that it would be efficient for the courts to recognize such a ban if a large enough segment of the population wants it. (And this is no way intended to suggest that one Michael Bloomberg by himself constitutes a large enough segment of the population.)