There are also ways to compile JVM bytecode (including compiled Kotlin and pure JVM libraries) to JS that can shake off most of unused code (including parts of stdlib), for example
http://teavm.org/. But I don't think it will be useful as TypeScript replacement in this case.