It is not related to this PR, but I think we can do some micro optimization here: 1. Let's change the list to a set for fast check 2. Initialize the set before for loop _Originally posted by @ryanking13 in https://github.com/pyodide/pyodide-build/pull/168#discussion_r2174912287_