It doesn't matter if it is / kill @e [type = creeper] and so, the main thing is that nothing drops.
I'll build the command into the code and run it every few seconds. This saves me a lot of code…
I can't take these critters anymore. Every time you farm for 2 hours, there are 4 of these things and… BOOM! Now that's enough for me.
Basically you can only exhibit this with mods. With commands such as "/ gamerule mobgriefing false" you can only prevent the creepers from doing block damage.
The other mobs should still function normally
As already said, only with mods, otherwise only with the command as described above. Alternatively, you can set the difficulty level to Peaceful while you are farming.
/ tp @e [type = minecraft: creeper] ~ 1 ~
Is my current solution
If you kill the item directly, you get the same effect:
/ kill @e [type = item, nbt = {Item: {id: "minecraft: gunpowder"}}]