I've completed Adventure Mode on three occasions when I remembered to make a note of the bonus, and there is definitely a pattern to it:
- 44 retries, 1.2 million points
- 40 retries, 2.0 million points
- 29 retries, 4.2 million points
From that, I assumed that you lost 200,000 for each retry, and that a "perfect" game with no retries would give you 10 million points. I was not able to get official confirmation, but this thread mentions both the 10 million bonus with no retries and other comments that would match that pattern (9.6 million with 2 retries, 5.8 million with 21 retries, 8.4 million with 8 retries). There is one comment that doesn't seem to match, but it's not specific (14 retries, 8+ million), so that could easily have been a math error (calculating efficiency bonus after the fact instead of recording what was on the screen).
Keeping in mind that in addition to the end-of-game efficiency bonus, you get a 100,000-point end-of-level bonus for completing a level on the first try, 50,000 on the second try, or 25,000 on the third try ... that means that if you choose not to complete a level on try 1, you are passing up 250,000 points (200K for the retry, 50K for the completion bonus), so restarting means that you have to make up that many points the second time through.
So in general, it does not make sense to restart a level to try to get a higher score. With few exceptions, you're simply not going to make up the points you lose by retrying the level.