Assuming you're in the terminal and the ~/blocks folder, just:
cat blk00000.dat| xxd -p | grep -oE '1976a914[0-9a-f]{40}88ac' | sed 's/1976a914//;s/88ac//' | sort -u > P2PKH-unique00000.txt
It shouldn't take longer than 1-2 seconds per .dat file, even on an old budget computer.
I tried the command and the result seems to be correct from quick check. It's also fast, although i use SSD and my computer isn't very old either. And since i'm not familiar with
blk file structure, do you think there's possibility of false positive?
Yeah, about the title. I think this is the world's fastest and simplest solution; I will, of course, change it when/if proven wrong.
Although i bet some low level programmer would take your statement as challenge to build something faster

.
1. One source of false positives I can think of would be if the pattern [ s ] appears elsewhere, such as in pushed arbitrary data (OP_RETURN). From a purely statistical perspective, the chance is virtually 0. Unless some people and/or miners use such for something (maybe Layer 2 stuff, or simply to f* around). I hypothesize false positives on the actual mainnet blockchain are exceptionally rare. Still, I haven't taken the time to quantify the exact number (and I would be surprised if it wasn't very, very close to or exactly 0).
2. The blk files simply the blocks as they come, the tx data bundled into ~130 MB "units" for convenience/standard, and saved as raw bytecode to be space-efficient (using all 256 bits (0x00-0xFF) instead of limiting itself to the number of an alphabet (hexadecimal is only 16 "letters", duh!). That's why they look funny, and maybe get you to think "this gotta be some weird code", if you open them as they are without first converting to something human-readable.
3. Way above my pay grade, but of course, I am all for it! Low-level-geeks, give it a try! I will credit you.