When does there have to be a new engine? The engines have seals. If there are anything that can be repaired internally hire a FIA inspector and to watch and certify nothing has been done to increase performance and put seals back on the engine. Does a burned piston destroy the engine? Send to factory for repairs or done at the teams shop using factory certified parts. Run on dyno to show the inspector that there is no hp gain. Would not count against the 5 engine rule. Install new piston sleeves maybe.
Refueling may be needed with a simple alternative engine. It would not have the efficiency of the hybrid engines. Inycar does ok doing this and limiting RPM to 12,000.