And SHGetFOlderPath compiled on older systems is a dynamical linked function; hence this function will not be removed from the kernel until all 32 bit applications die out (maye around 2025 given how long 16 bit programs did work).
It is still a dynamically linked function (well SHGetFolderPathA and SHGetFolderPathW are, SHGetFolderPath is and has always been a macro). As far as I know, everything in Win32 is either that or a COM interface. (And it's not part of the kernel. The kernel API is mostly undocumented, apart from what drivers use.)
Curiously, the predecessor to SHGetFolderPath, SHGetSpecialFolderPath, is still documented on MSDN despite being replaced, and likely deprecated, 15 years ago. I'm not sure when support ended, but it's clearly of the "it might still work, but we won't help you if it doesn't (except when we do)" kind if one knows Microsoft's history of compatibility. (Not that there is any reason for us whatsoever to even consider using SHGetSpecialFolderPath anymore.)