I was editing a hypnotism-type feature I designed for homebrew spellcasting class, when it struck me that I should probably insert a warning about what happens once this hypnotism wears off. The reason I thought I had to do this has to do with a rider added to the 5th edition D&D Charm spell - a very potent weapon for low-level magic-users in previous editions, but, in the view of many players, significantly weakened in the new ruleset.
Aside from reducing the duration from several days (or even weeks, or more) to one hour, and changing the effect from having the affected creature do what you want (as long as it wasn't suicidal) to having it regard you merely as a "friendly acquaintance", the main change is that after the effect ends, "the creature knows it was charmed by you" (PHB, p. 221). Since the release of 5e, many pixels have been used to argue that the spell is essentially rendered useless by the last provision, apparently because the risk of being outed as a blackguard who practices mind control makes all your plans to gather information or practice sabotage in the shadows - presumably, the ends you had in mind when you tried to charm the creature - go up in smoke.
The conclusion that having the victim of the Charm know what you tried to do to it renders the spell useless is widely off the mark. Charm is only a 1st level spell, and even if the charmed creature now hates the charmer, as many assume, the spell is still quite useful - in the short term, it prevents bloodshed and saves lives (likely including those of the caster and the caster's companions). The fact that Charm is still a frequently-cast spell speaks to its continued utility.
Second, older versions of the spell did not stipulate that the target of the Charm would remain ignorant of what happened to her. There was no provision that mind-altering (much less memory-altering) effects would persist after the spell ceased functioning (though the much longer duration of the effect mitigated the impact of the victim's realization of what had happened). What 5e has done is to issue a clarification, not a change.
More substantively, precisely because the spell does not alter long-term memory, there is absolutely no reason to assume that the end of the spell effect allows the victim to know who the caster was if the victim does not possess any special insight regarding that fact. If you charm a goblin you've never met in a dungeon corridor, all the goblin knows is that some fat human in a green hat tried to charm him. He will not know the fat human's name, occupation, where he came from, etc. More importantly, if the same goblin is charmed by a person who gives a false name (someone else's name), by a person in disguise, or a caster concealing her identity with, say, a Disguise Self or Alter Self spell, he will not have any way of knowing that Ferdous Crugg the Fat Male Human in the Green Hat is really Lainel Coronnim, the Skinny Female Elf in a Kerchief. The more preparation you put in making your Charm work better, the better the long-term payoff will be when the spell ends.
Finally, and most importantly, the notion that as soon as the victim realizes she's been charmed, she calls 911, and the authorities put out an APB for the caster flies in the face of what we know about how abuse works. Certainly, casting a Charm on someone is intrusive, and a form of abuse. But like other abusers, the charming caster can make it abundantly clear before the spell wears off (e.g. by using Intimidation, or perhaps another spell) that revealing any information about him and what he did will have very deleterious consequences. He knows where the victim lives, and has already demonstrated his arcane prowess by charming her.
Aside from being frightened into submission, the victim may simply feel too ashamed to tell anyone else what happened. Even if witnesses friendly to the victim were present during the charming, the victim may in fact attempt to blame himself for his behavior at the time. It's not that he was under the effect of a mind-controlling spell, it's just that he used bad judgment and made bad decisions and aided the enemy. His friends do not have any special out-of-game knowledge about whether their companion failed a Wisdom save or not.
Alternatively, instead of intimidating or shaming the victim, the caster can try to make the experience pleasurable. Here is this great wizard or sorcerer, and she wants to be my friend. She lavishes attention on me and treats me with respect when my so-called friends ignore me or make me the butt of their jokes. She gave me 10 gp, and promised to give me a magic item later. So what if she was using a spell? If she keeps treating me like this, she can Charm me any day of the week. Perhaps, depending on how he was treated, the victim develops feelings for the caster that last long after the spell has ended. Or if not feelings, then a Stockholm Syndrome-like understanding - sure, that bard who charmed me was Chaotic Evil, but he is just a product of his environment, and his party was actually fighting for a good cause.
There are many opportunities for strategizing and role-playing with this spell, and taking the time can really improve its functioning and add enjoyment to the game. And the same goes for my custom sorcerer's Heavy Gaze ability I was talking about at the start. I ended up inserting text into the description that said the victim becomes aware it was mind-controlled, but could be persuaded or intimidated to keep quiet about it.