According to Sanseido Daijirin (三省堂 スーパー大辞林), this is a somewhat archaic word which was read in kanbun texts by means of kundoku (reading the kanji of a Chinese text in Japanese). It comes from the word 事事 (ことごと), meaning 'everything', and the suffix く. This gives it an adverbial format (although it may not strictly conform to modern adverbial behavior), and it is usually (but not always) followed by a verb.
The standard dictionary meanings are '
all; entirely; completely; without exception'. Exactly which one of those translations is most appropriate will depend on the details of the context. But they are not different concepts. For example:
ことごとく失敗する to fail completely
財産をことごとく失う to lose all your assets (to lose everything)
法律をことごとく守る to obey the law without exception
As for your point about using alternative kanji for the word, that is certainly possible but I would argue that those are stylistic variations of the meaning, rather than standard usages. Stylistic variations are an interesting aspect of kanji (there are some good threads about it here if you search), but there is no need to use them unless you have a specific purpose in doing so. Sticking with standard characters is perfectly fine. The kanji listed in dictionaries like Daijirin, Kojien and Shinmeikai (悉くand 尽く) are standard, although the word is very often written in hiragana.