After Force-choking Director Krennic, Darth Vader makes the comment
Be careful not to choke on your aspirations, Director.
This comment displays a sense of humor that seems entirely out of character for him. Is it ever explained in-universe?
Vader has quite a dry sense of humour and can often be found quipping at mildly inappropriate moments, especially when choking people, which he really seems to enjoy.
One assumes this is a habit he's picked up from his mentor Obi-Wan "so uncivilised" Kenobi.
VADER: I find your lack of faith disturbing [as he's choking Motti]
VADER: Apology accepted, Captain Needa. [As he's choking Needa]
VADER: We would be honored if you would join us. [Inviting Leia, Han and Chewie to dine with him after capturing them]
VADER: Perhaps you think you're being treated unfairly. [As Lando complains about the deal he's made being changed]
VADER: Perhaps I can find new ways to motivate them. [When told that the construction crews are working at full capacity]
VADER: The Emperor is not as forgiving as I am. [as a not-so veiled threat]
In the Revenge of the Sith novelisation he's even quippier when dealing with the Separatist leadership, indulging in some word play and even a pun or two.
“We were promised a reward,” she gasped. “A h-h-handsome reward“
"I am your reward,” the Sith Lord said. “You don’t find me handsome?”
“You fought a war to destroy the Jedi.” Vader stood above the shivering Neimoidian, smiling down upon him, then fed him half a meter of plasma. “Congratulations on your success.”
The head of the Techno Union turned at his approach, cringing, arms lifted to shield his faceplate from the flames in the dragon’s eyes. “Please, I’ll give you anything. Anything you want!”
The blade flashed twice; Tambor’s arms fell to the floor, followed by his head. “Thank you.”
“The war is over-Lord Sidious promised-he promised we would be left in peace …”
“His transmission was garbled.” The blade came up. “He promised you would be left in pieces.”
and again in Tarkin when killing Phoca Soot in front of a group of Coruscanti gangsters and criminals.
His eyes glazed over and his red skin began to pale; then his arms flew back from his chest as if in an act of desperate supplication, and he tipped backward, the left side of his head slamming hard against the blood-slicked floor.
For a long moment, Vader’s breathing was the only sound intruding on the silence. Without bothering to gaze on his handiwork, the Dark Lord finally said: “Perhaps this is a good place to conclude our assembly. Unless any of you have questions?”
Since his days as annoying, whining, but deadpan-snarking Padawan (and he learned the snark from Obi-Wan, if nothing else).
General Grievous, You're Shorter Than I Expected.
Anakin: Under the circumstances, I'd say the ability to pilot this thing is irrelevant.
Obi Wan: Wait a minute, how did this happen? We're smarter than this!
Anakin: Apparently not.
Obi-Wan: Oh Anakin, where is your lightsaber?
Anakin: I know exactly where it is. pointing at a battle droid It's right there.
Obi-Wan: How could you let this happen?
Anakin: Hey, he's got your lightsaber too, you know.
Obi-Wan: I really don't think that's the point.
Anakin: This weapon is your life, Obi-Wan!
Obi-Wan: Yes, alright, you've made your point.
OBI-WAN: Oh, so all of a sudden it's my fault.
ANAKIN: You're the Master. I'm just a hero.
Dooku: That was brave, boy, but foolish. I would have thought you'd have learned your lesson.
Anakin: I'm a slow learner.
It seems pretty fitting actually, considering his attitude in the prequel trilogy, then his rogue one quips, then how much darker, dry, and sadistic his remarks become in the OT. The stress of being a sith Lord will take the piss out of even the cockiest of smartass. If phantom menace Anakin starts the spectrum and return of Jedi Vader ends it, it's pretty clear he's always been a smartass and the stress of a job in government made him a grouchy old curmudgeon.