How to set a global (static?) variable that is reset on each build, even within the same daemon runtime

I don’t have a perfect understanding of how the Gradle Daemon works. However, I have observed global variables staying the same between builds.

I use kotlin for my gradle plugins. Sometimes, I set a global lazy val or a global object which I want to always reset between builds, as if each build was its own runtime. However, I don’t want to disable the gradle daemon completely. Is there a way to register some sort of global properties for kotlin that are lazily evaluated once per build, available to all projects and compatible with parallel execution, even without resetting the daemon?

Yes, static state is always a bad idea as you have found out.
This can even influence builds of different projects running on the same daemon.
What you are after is a shared build service: Shared Build Services

Thank you, I knew there must be something.