C-3PO's memory-wipe from Revenge of the Sith may be a convenient way to avoid a plot hole, but it was worked into George Lucas' vision of Star Wars from the very start. Anthony Daniels is the only actor to appear in all 10 theatrical Star Wars movies (so far), with all but Solo: A Star Wars Story seeing him play protocol droid C-3PO; however, this has at points caused some continuity issues.
In the prequel trilogy, it was revealed that goldenrod had been built by a young Anakin Skywalker when he was a slave on Tatooine. He was eventually given (silver-grey) plates, then ended up wrapped up in the Clone Wars, serving as Padmé Amidala's servant before passing over to Bail Organa once the Emperor rose. While that directly tied into where we meet him and R2-D2 in the original Star Wars, it posed a bit of a logic problem: C-3PO had been privy to a lot of secrets regarding Anakin's fall to the dark side, so why wouldn't the loose-lipped droid mention this to Luke Skywalker twenty years later? The solution was to have his mind-wiped at the end of Revenge of Sith.
While this may at first appear like a convenient (read: last minute) plot fix, it seems like this was actually always part of Lucas' plan for the character. In 1977, the maker defined his new universe with a string of in-character dialogues that expanded upon ideas teased in Star Wars (repeated in J.W. Rinzler's The Making of Star Wars); while they're no longer canon, they give great insight into how he initially viewed the greater story. One of these as C-3PO discussed his life before the Tantive IV with R2 and coyly hinted at a memory wipe:
"I believe Artoo had his memory erased several times, but I'm sure that horrible fate never befell me."
While C-3PO clearly believes he hasn't had his memory erased, the overstatement in the writing definitely indicates that it has happened to him (the tricksy R2-D2 can just keep his mouth shut). At the time Lucas wrote this, he hadn't reached the decision that Darth Vader would be Luke Skywalker's father (that didn't appear until the second draft of The Empire Strikes Back), but the idea was still there. Even if it's not quite as overt as the discussion of a slave building C-3PO Lucas made around the same time, it does show just how many prequel ideas were conceived of in the very early days.
That said, there is some further dialogue in this that either indicates a change in the plan for C-3PO or is meant to ramp up C-3PO as an unreliable narrator:
"Actually, I met Artoo just recently. I didn't meet him until we on the Tantive IV. He was attached to that vessel for, I believe, a dozen of years before I got there."
In the movie itself, Threepio and Artoo come across as firm friends - he remarks to Luke "With all we've been through, sometimes I'm amazed we're in as good condition as we are" - so it would be strange for him to downplay that assumed history. It's possible this is meant to further indicate his grasp on past events is skewed, although could indicate that their pasts weren't intended to be as originally intertwined as the Star Wars prequels made them.
Lucas has long maintained that Star Wars is actually a retelling of events by R2-D2 far in the future to mystical beings the Whills, but that doesn't mean it's exactly necessary for C-3PO to be with him prior to A New Hope. At the same time, their comradery means them having spent decades intersecting key saga events makes sense - and, thanks to Lucas' teasing, so too does Threepio's plot hole-saving memory wipe.
- Star Wars 9 / Star Wars: The Rise of Skywalker (2019) release date: Dec 20, 2019