They are equivalent. The heavy lifting here to calculate the key hash. In both sections, it happens twice: add to a dict and then add to set. Other procedures should be light. You can use debugger to show the C calls to verify.
In addition to function call overhead mentioned by Carcigenicate, memory management might also play a role. If the set knows the length, it could possibly avoid copying data over when the predefined space isn't enough.