For groovy syntax, turning off auto-import in gradle settings does it. Ide then prompts when there's a change to build.gradle file and you control when it does import.
Hopefully works same for kts variation but I don't use kotlin dsl so can't confirm that.