Can I disable a global before_script on an included template?

In my .gitlab-ci.yml I have :

image: my-image-with-do-stuff
include:
  - template: Security/License-Scanning.gitlab-ci.yml
stages:
  - license_scanning
  - deploy
default:
  before_script:
    - do-stuff
deploy:
  stage: deploy
  script:
    - do-things dependant on do-stuff

Obviously with more stages etc… that would make duplicating do-stuff in each stage annoying to manage. But hopefully that’s all the relevant bits!
When the templated stage runs it uses it’s own image which doesn’t have do-stuff installed and fails.

I tried making an “empty” stage for licence scanning :

licence:
  stage: license_scanning
  before_script: []

But it complains I don’t have a trigger or a script. I don’t want to specify anything really other than disabling the before_script.

Is this possible or do I need to rewrite my before script to only run do-stuff if it is installed??

Was there a resolution to this?