From the spctl manual we can add an hidden option in the System Preferences > Security and Privacy > General panel with the following command:

sudo spctl --master-disable

You will see an Anywhere option for the Allow apps downloaded from: menu.