I agrre that it is technically possible to have a completely optimal script. I just don't think it's feasible.
or even play style, players can have.
// Reset certain settings that the player almost certainly will
// use differently at the beginning of a run vs. at the end.
MoodManager.setMood( "apathetic" );
Preferences.setFloat( "hpAutoRecovery", -0.05f );
Preferences.setFloat( "mpAutoRecovery", -0.05f );