Hmm, right. The problem is there won't be any tag stating an item is made with production modules (or whether with +16%, +24%, +40% or whatever) or not... I can think of the following solutions:
Solution 1: Return only 1/(1+40%)=0.7143=71% of ingredients. The problem is if an user uncraft a single burner inserter, what should I return? 0.71 iron plate and 0.71 iron gear wheel? Should I round it? Ceiling? Or floor? Another problem is with other mods or future versions. Some mods have something like productivity module 4 or extra module slots. Should I put the return ratio to a even lower one, to avoid exploit?
Solution 2: One may say burner inserter cannot benefit from productivity modules. Okay, only limit those to intermediate products... Separating intermediate products from ordinary products makes the code a bit more complicated, but totally doable. Still suffer from the same rounding problem, and max productivity bonus problem.
Solution 3: An option allowing the player or host (in MP game) to set the return percentage. Maybe the most flexible option? But still suffer from the rounding problem when uncrafting single item. In single player game, players who want to exploit will just set to the 100% or max setting anyway. (Or they could exploit better and faster with other mods...) In MP server, the host decides the setting and choice of mods, so not a problem though.
Anyway, it is not entirely free, since the cycle uses some energy, and time of players to do this kind of clicking instead of time to ramp up their production. If this is game breaking, then productivity modules that create extra products are equally game breaking as well. I am not sure what I can do to it...
If just for concern of MP game, solution 3 could be the most effective one. But still how should I deal with the rounding/ceiling/flooring problem when uncrafting small quantity items?