[libc++] Replace uses of _LIBCPP_WEAK with [[gnu::weak]] (#171798)
Using `_LIBCPP_WEAK` doesn't give us anything that using `[[gnu::weak]]`
directly couldn't, so we can just expand the macro.
As a drive-by this also refactors `_LIBCPP_OVERRIDABLE_FUNCTION`.