The only time I had anything near this was as a total rookie with around 60 hours, I hadn't set the throttle friction on a 172, and the steep climb angle caused the throttle to slide back. I never took my hand off the throttle during the climb again!
My advice would be use available power to get down to the best field close by and then glide in. But always land asap - you may still have a potential full failure awaiting you!
For me this is the best advice, and what I would teach. I may well offer a partial power reduction as an EFATO, but would still expect the student to take whatever is in front of them. Aircraft can be replaced, people cannot, I'd rather a student hobble away from a wreck a couple of miles away rather than stall trying to nurse a dodgy engine back to the airfield.