We can assign eachScript value to a bit and storeScriptExtension as a bitfield made of threeu64s. Intersection becomes fast, and we can use popcnt to find if something is single script. We can export constants for each script value to make this easy to use.
cc@crlf0710