The write-lock is checked entirely at compile time, so no performance overhead
Am I missing some clever trick?
There are ways to avoid locks, but the stdlib implemtation doesn't do it. There are probably a bunch of crates that implemented concurrent BTrees, though.