Take a look at my reply half a year ago. That is in an android context, but there is nothing android-specific to the solution:
I see, that is where the stackoverflow answer comes from as well. The amount of classes should be fairly limited so I would stick with manually enumerating them. Of course you could configure gradle with a filter (instead of manual exclusions) and in that filter check for containment of the name in kotlin-stdlib → better yet, cache this somehow as it’s not really fast.