The phrase "could not" can be used in several ways, which does make it ambiguous. However, its usage in a sentence is not usually ambiguous in context. The past tense of "can not" (meaning "was able to not") uses the past perfect tense with a participle of the main verb, while the past tense of "cannot" (meaning "was not able to") uses the simple past tense with an infinitive of the main verb.
For example, to say that it was possible for me to not go to the store in the past, I would say "I could have not gone to the store." In contrast, to say that it was not possible for me to go to the store in the past, I would say "I could not go to the store."
When the past perfect tense of "cannot" is used, the word order changes from the above to show that the negation belongs next to the "could": "I could not have gone to the store."
When using "could" in the present tense to indicate future possibility, the structure is the same as the simple past tense. "I could not go to the store." Being this is a different tense altogether, though, context should let the reader know what is intended.
"I needed to get flour but the car wouldn't start. I could not go to the store." (I was unable to go to the store)
"I could save some time on my way home by eliminating some stops. I could not go to the store." (It's a possibility that I do not go to the store)
Even with context, though, it's still possible for a sentence to be ambiguous. Consider the following:
"I need to get home before the kids do. I could not go to the store."
This could mean that I am considering the possibility of skipping a trip to the store in order to ensure that I get home more quickly. Alternatively, it could mean that because I was previously unable to go to the store, I now need to make sure that I get home first. Even though the first sentence is in present tense, the second could be in either present tense or past tense, depending on my intended meaning.
It's worth noting also that the contraction "couldn't" is always used as a form of "cannot," similarly to how "can't" is a contraction of "cannot" but never of "can not."