“We use for + the -ing form of a verb to talk about the function of something or how something is used.”
This dictum from English Grammar Today might have two very different meanings:
“To talk about the function of something or how something is used we must use for + the -ing form of a verb.”
This is simply wrong. There are other ways of talking about these functions, even if we restrict ourselves to the constructions licensed by the verbs use and need: a marked infinitive, a subordinate clause introduced by in order that or so that or to the end of or for the purpose of. In fact, the quotation itself uses a marked infinitive with use for exactly that purpose: to talk about the function of, &c.
“A use of *for + the -ing form of a verb is to talk about the function of something or how something is used.”
This is quite a different matter. This talks about what the construction is good for—or one of the things it is good for, since it has other uses, such as specifying the reasons for an award or an arrest.
Context, context, context!
In the first example,
No person could have been more nationalistic.
there is an implied subject of comparison, probably a particular person who has already been established as the subject of discussion. A more complete statement would be,
No person could have been more nationalistic than Joe.
The literal meaning is, "it is not possible for a person to be more nationalistic [than Joe]", or "Joe is as nationalistic as it is possible for a person to be."
Such phrases are, of course, often used with an element of rhetorical exaggeration or hyperbole, so it's possible the speaker doesn't actually believe the statement in its literal sense.
I couldn't have been better.
Here the implied comparison with other states of being you might have had at some moment. A more complete statement would be,
I couldn't have been better than I was [at that moment].
There's no "supposed person" here because what you are implicitly comparing is not between you and other people, but between how you were and how you could have been.
This can possibly be changed through context:
Joe was good at chess. I couldn't have been better (even if I practiced daily).
Best Answer
In short, "ever" cannot be used to make an assertion, but rather to ask a question, or an embedded question (wh-clause).
For instance
The wh-clause "whether I have ever been to New York" cannot be used by itself; it is dependent on another clause.
Also note that we can make a statement with "ever", if it is negative. This is based on the principle that "never" can be regarded as a condensation of "not ever"
Finally, structures like "have I ever been ..." are possible, if they express irony or emotive emphasis. For instance, "Boy, have I ever been cheated!"
This could somehow apply to New York.