Behat tests can use TestOnly extensions. For an example of this, see silverstripe/silverstripe-elemental#930
There is likely some content in here that is intended for use in behat tests which can be implemented via Extension classes. We should evaluate to see if that's the case and migrate any such code into the relevant modules.