Interestingly, this makes things slower, by itself.  I imagine that being prepared against a temporary table which is then dropped, and then being executed against another temporary table with the same name and geometry, causes the prepare to effectively happen again.

If I remove the dropping of the temporary tables, though, the combined result is faster than previously.