Now it's getting sad/worrisome/interesting. With my old 5.26 Perl, your script above reports empty arrays as expected (and, as a side note, some reasonable content if run with administrative rights). Also, I finally did mega-stress-test (sweep C:/ for 100 times), it completes OK.
Then I tried latest recommended Strawberry Perl versions 5.30.2.1, 5.28.2.1, 5.26.3.1, -- under 5.28 and 5.30 results are as you report: random bytes/single characters for "protected operating system" (as MS UI calls them) folders. The "mega-test" (tried once) hung on 5th sweep, though I was able to ctrl-C it. So, definitely looks like a bug (somewhere in Win32::LongPath XS guts?).
Update. Actually, the bug is not related to "special system" directories, and I'm no longer sure Win32::LongPath under 5.26 behaved correctly, too. Maybe the call to opendirL shouldn't succeed in the first place.
>perl -v
This is perl 5, version 30, subversion 2 (v5.30.2) built for MSWin32-x
+64-multi-thread
Copyright 1987-2020, Larry Wall
Perl may be copied only under the terms of either the Artistic License
+ or the
GNU General Public License, which may be found in the Perl 5 source ki
+t.
Complete documentation for Perl, including FAQ lists, should be found
+on
this system using "man perl" or "perldoc perl". If you have access to
+ the
Internet, point your browser at http://www.perl.org/, the Perl Home Pa
+ge.
>mkdir abc
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
[".", ".."]
[".", ".."]
[".", ".."]
[".", ".."]
[".", ".."]
>icacls abc /deny Everyone:F
processed file: abc
Successfully processed 1 files; Failed processing 0 files
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
["\b"]
["\b"]
["\35"]
["\32"]
["'"]
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
["\3"]
["\26"]
["#"]
["\22"]
[4]
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
["M"]
["~"]
["M"]
["w"]
["I"]
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
["M"]
["}"]
["C"]
["l"]
["}"]
>icacls abc /remove:d Everyone
processed file: abc
Successfully processed 1 files; Failed processing 0 files
>perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon
+gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}"
[".", ".."]
[".", ".."]
[".", ".."]
[".", ".."]
[".", ".."]
>rmdir abc
>