[8.x] backport node.cc changes
8.x backports for https://github.com/nodejs/node/pull/20917, https://github.com/nodejs/node/pull/21105, and https://github.com/nodejs/node/pull/21112
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines