As a DM, I enjoy [metaphorically] playing with fire.
For no particular reason, I am considering introducing the following Rite to my campaign:
Rites of Destruction. When the world was created, the Gods left in a secret power that could be used to completely destroy the universe instantaneously, and remake it with new parameters at the whim of whomever used this power (after which the power then leaves them).
Although intended only for use by the gods, this power can be attained and used by any mortal that, within a span of one week, casts every single Cantrip in existence using their own spellcasting abilities (i.e. no Magic Items) in a specific, secret ordering.
Setting aside the improbability of a player correctly guessing the exact order of Cantrips to cast with no assistance from me, the DM, is it even possible for a single correctly-built character to cast all 44 Cantrips (27 from the Player's Handbook, 12 from Xanathar's Guide to Everything, 4 from Sword Coast Adventurer's Guide, and 1 from Guildmaster's Guide to Ravnica) at all, within the span of a seven day week?
In my campaign, I permit the 2019 revision of the Artificer Unearthed Arcana, so for the purposes of this question, it is a valid class a character can take to try to obtain all the cantrips they need. Also, any Cantrips a Warlock is able to cast are valid unless they are acquired through the Pact of the Tome feature.
Furthermore, while using the Spell Duplication features of Wish is perfectly fine, using Wish to wish for "I want to know how to cast all cantrips" would definitely be twisted with so as to render this Rite inoperable by the person making that wish, so it's not a solution to this particular issue.
Best Answer
Disclaimer
This answer was written assuming Encode Thoughts was on the Wizard Spell List. While DNDBeyond lists the spell as a Wizard Spell, the Guildmaster's Guide to Ravnica book doesn't actually specify that the spell has an associated class. If your table accepts DNDBeyond's wisdom that the spell is indeed a Wizard spell, then this answer is valid, but if not, you'll need to see my revised answer which I've posted separately.
We can get there without Wish, without Epic Boons
The Character
Key Points
There's a few critical things we're gaining:
The Artificer's Right Cantrip for the Job feature
At level 10, an Artificer gains the ability to swap out their Cantrips, one cantrip at a time, per short or long rest. In order to cycle through all 19 Cantrips that an Artificer may prepare, they would need to rest 19 times in 7 days, averaging to about 3 rests per day. That.... is very easily attainable, given 1 long rest and 2 short rests each day.
So far: 19/44 Cantrips
Bard/Cleric/Druid/Sorcerer/Warlock/Wizard
The base Cantrips provided by each of these classes will add up:
Total from this group: 16 Cantrips
So far: 35/44 Cantrips
Archetypes
Some Archetypes of each of these classes will give us some additional Cantrips.
From this group: 5 Cantrips
So far: 40/44 Cantrips
Feats
Two feats give us some extra Cantrips
From this group: 3 Cantrips
So far: 43/44 Cantrips
Racial Feature
Many Races offer a Cantrip as a level 1 spellcasting feature. We could have gone with many different races (and see later for why we might have needed to) but Tiefling was my preference, so I went with it.
From this group: 1 Cantrip
So far: 44/44 Cantrips
Background
Each of the Guildmaster's Guide to Ravnica Backgrounds add spells to all of the spell lists that a character has, including 2 or 3 Cantrips.
This doesn't actually increase the number of cantrips we can learn, but it offers us some flexibility in how we allocate the cantrips to each class/feature.
Spell List (And Sources)
"But what if the GGR Backgrounds aren't allowed?"
There's an easy fix. Go with a High Elf instead, and pick Mold Earth as your Wizard Cantrip. The Druid then replaces Mold Earth with Druidcraft, and the Cleric picks up Thaumaturgy. Personally, I just like the Tiefling better, so that's what I went with.