Would it be in Germany's interest to have a independent pan Slavic Poland? It could pull the other slavic nations away from russia
For it to do that, it would need to be as powerful/influential as Russia, which Germany doesn't want at all.
And Austria-Hungary is the state that needs to get rid of pan-Slavism, not Germany. Poles are the only slavs in Germany, and as previously mentioned, they aren't too keen on pan-Slavism.
As for the OP, you'd have to change pan-Slavism as an ideology from being a euphemism for pan-Russianism. A weaker Russia is probably your best bet, or a Poland that isn't partitioned and subjugated quite brutally.
The big problem with pan-Slavism is that the Slavic cultures are already quite diverse by the time nationalism of the 19th century starts agitating for it. The South, West and East Slavs have some things in common, but the cultural differences and especially religious ones make the union a tricky proposition.