Repository: Kotlin/kotlinx.coroutines
File: buildSrc/src/main/kotlin/configure-compilation-conventions.gradle.kts (Kotlin)

Code before:
import org.jetbrains.kotlin.gradle.tasks.*
import kotlin.reflect.*
import kotlin.reflect.full.*

configure(subprojects) {
    val project = this
    if (name in sourceless) return@configure
    apply(plugin = "org.jetbrains.kotlinx.atomicfu")
    // Workaround for KT-71203. Can be removed after https://github.com/Kotlin/kotlinx-atomicfu/issues/431
    afterEvaluate {
        extensions.findByName("atomicfu")?.let { atomicfuExtension ->
            atomicfuExtension::class.memberProperties.firstOrNull { it is KMutableProperty<*> && it.name == "transformJs" }?.let {
                (it as KMutableProperty<*>).setter.call(atomicfuExtension, false)
            }
        }
    }
    tasks.withType<KotlinCompilationTask<*>>().configureEach {
        val isMainTaskName = name.startsWith("compileKotlin")
        compilerOptions {
            var versionsAreNotOverridden = true
            getOverriddenKotlinLanguageVersion(project)?.let {
                languageVersion = it
                versionsAreNotOverridden = false
            }
            getOverriddenKotlinApiVersion(project)?.let {
                apiVersion = it
                versionsAreNotOverridden = false
            }
            if (isMainTaskName && versionsAreNotOverridden && !unpublished.contains(project.name)) {
                allWarningsAsErrors = true
                freeCompilerArgs.add("-Xexplicit-api=strict")
            }
            /* Coroutines do not interop with Java and these flags provide a significant
             * (i.e. close to double-digit) reduction in both bytecode and optimized dex size */
            if (this@configureEach is KotlinJvmCompile) {

Review comment (suggestion):
The problem is that `AtomicFUPluginExtnesion` type is not accessible in the root build script yet, and seems that the only way to dynamically set the property in this extension class is via reflection 🥲
(At least the config is not scattered across the build scripts of all the subprojects)

Code after:
import org.jetbrains.kotlin.gradle.tasks.*

configure(subprojects) {
    val project = this
    if (name in sourceless) return@configure
    apply(plugin = "atomicfu-conventions")
    tasks.withType<KotlinCompilationTask<*>>().configureEach {
        val isMainTaskName = name.startsWith("compileKotlin")
        compilerOptions {
            var versionsAreNotOverridden = true
            getOverriddenKotlinLanguageVersion(project)?.let {
                languageVersion = it
                versionsAreNotOverridden = false
            }
            getOverriddenKotlinApiVersion(project)?.let {
                apiVersion = it
                versionsAreNotOverridden = false
            }
            if (isMainTaskName && versionsAreNotOverridden && !unpublished.contains(project.name)) {
                allWarningsAsErrors = true
                freeCompilerArgs.add("-Xexplicit-api=strict")
            }
            /* Coroutines do not interop with Java and these flags provide a significant
             * (i.e. close to double-digit) reduction in both bytecode and optimized dex size */
            if (this@configureEach is KotlinJvmCompile) {
                freeCompilerArgs.addAll(
                    "-Xno-param-assertions",
                    "-Xno-call-assertions",
                    "-Xno-receiver-assertions"
                )
            }
            if (this@configureEach is KotlinNativeCompile) {
                optIn.addAll(
                    "kotlinx.cinterop.ExperimentalForeignApi",
                    "kotlinx.cinterop.UnsafeNumber",