I created a
PR that has reduced this task time by a good amount for me if you want to try it out.
The KotlinJvmCompile task is read in the configuration phase and for all variants, so if you have multiple buildTypes and product flavors, it's forcing all of those to be realized even if you're only running a single variant.