Not really.
Let me do a example.

1. My executable path is:
*E:\User\Me\Doc\blah\_250 characters_\blah\this\is\a\very\long\path\openframeworks\apps\myapps\thisapp\bin\thisApp.exe*
So it's about 480 characters.

2. For me `MAX_PATH` is 260. Simplify it at 201, => `executablePath` allows 200 characters.
`GetModuleFileNameA(..., &executablePath[0], ...)` return value with `executablePath[0]` number of characters, so 200 => `result` is 200 since my path > 200 characters.

3. `result` == `executablePath.size()` but `executablePath` do not contain all the path.
So multiply his size by 2 and retry it with 400 characters. 
=> Here, your `for` proposition is **exactly** the same as a `while`.

4. OK, we get `result` == 480, and `executablePath.size()` 800, so return it.

In fact, it's to create `executablePath` with a size as needed.