Use a settings plugin and apply the task to the root project. This way it is impossible that another task gets registered by any project, since the plugin that applies the task cannot be applied in a build script.
Alternatively you could use a build service that performs the actual work. This would allow for multi registration of the task, but the work (with its state) is handled by the build service.