There seems to be a regression in musl 1.1.20, yarn/npm builds started breaking in docker containers all of a sudden. Same issue was also reported for alpine images: https://github.com/yarnpkg/yarn/issues/6384#issuecomment-422830091 The referenced patch at https://git.musl-libc.org/cgit/musl/diff/?id=f381c118b2d4f7d914481d3cdc830ce41369b002 resolved the issue for me.
I've added this patch to musl-1.1.20-r1.ebuild. Let me know if it works for you and I'll stabilize it and remove the older 1.1.20 with the regression.