Mandy Patinkin in Chicago Hope comes to mind, as does Hugh Laurie in House, where the shows give the actors the chance to sing/play just to have an extra opportunity to let their other talents shine on the show for a bit, but otherwise unnecessary to the plot and stories.
TV shows do this all the time. There’s even a TV Tropes page about it.
Well, in Top Secret!, Nick Rivers (Val Kilmer) was an American pop singer, on a cultural-exchange visit to East Germany, so him breaking into song fits the plot, especially when you realize that Zucker, Zucker, and Abrahams (the writers/producers/directors) were intentionally spoofing Elvis movies (as well as WWII movies and spy movies).
It used to be a way to sell records or pick the low hanging Oscar (Best Original Song).
Clint Eastwood and Lee Marvin both sing in Paint Your Wagon.
I did everyone the favor of not linking to any videos of their ‘vocal stylings’.
Stranger
Eastwood’s not too bad, and he later made a film in which he played country singer Red Stovall (Honkytonk Man).
Marvin doesn’t so much “sing” as “emit vibrations so low they are more felt than heard”.
There’s shoehorning a song into a non-musical for a singer. Then there’s shoehorning a non-singer into a musical.
This example is pretty much the exact opposite of the question in the OP: a non-musical movie in which one of the actors is a real-life singer, and a song is inserted into the movie solely because the actor is a singer.
Paint Your Wagon is a musical…suddenly breaking into song is completely normal for the genre. The fact that they cast actors like Eastwood and Marvin, with limited-to-no singing ability, is either an intentionally funny meta choice on the part of the producers, or just a tragic choice.
They were both non singers, and the movie was a musical, so I would say it is the opposite of what the OP is looking for.
I was intending to be ironic, or at least, willfully and cheerfully misinterpreting the o.p.
It is certainly a most bizarre film, and it is unclear how Paddy Chayefsky got roped into writing this monstrosity but it has become a cultural touchstone of sorts.
Stranger
I know we’ve drifted off topic but for the record I like Paint Your Wagon. Some of the songs are fun, and the whole blithe acceptance of a poly relationship until churchy people turn up to ruin it is a novel twist.
The film adaptation of Guys and Dolls gave Nathan Detroit additional songs to show off Frank Sinatra’s singing voice.
What I never understood was in The Great Race when the entire movie grinds to a halt so Natalie Wood can sing the romantic ballad The Sweetheart Tree. And the studio put the lyrics onscreen in the theatrical release so the audience could sing along - which was difficult, as the audience had never heard the song before.
It certainly couldn’t be to hype Natalie Wood’s singing career, as she was already famous for being lip-synched in any song she performed. And when it came time for the Academy Award for best song, Mancini found himself overshadowed by The Shadow of Your Smile, (If It Takes Forever) I Will Wait for You, and even What’s New Pussycat.
In execution this song wasn’t “just because” so it doesn’t fit the OP. But the song wasn’t planned ahead of time. They heard Billy Boyd singing karaoke with the cast and decided to add a song for him. So maybe it does fit the OP.
I’m usually more intrigued by this situation- where they cast a well known singer, and then don’t have them sing, or if they do, it’s the credits song or a song that’s not going to be popular.
I saw Austin Powers in Goldmember yesterday, and IIRC, the only song Beyonce sung was “Hey Goldmember”, which was both a parody song, and the introduction for the main villain. The song or her were not the focal points of that scene.
Speaking of Austin Powers, how about the Burt Bacharach/Elvis Costello number? Neither person shows up anywhere else in the movie - just that one scene.
[deleted]
And sometimes they realize how much talent they have in the cast and just have to do a musical episode.
Melissa Benoist and Grant Gustin were both in Glee. So for the Arrowverse musical crossover they brought in Darren Criss. They already had John Barrowman, Victor Garber, Jesse L. Martin and Jeremy Jordan on payroll.
The whole film is an homage to early movies and the movie-going experience (You don’t have to look any further than the titles). The bouncing ball sing-along was a staple in the early years of movie theaters.
Arguably, every film version of Hamlet that includes Ophelia’s mad scene: Shakespeare’s company clearly had a musically talented boy actor from around 1598 to 1604-ish. The overwhelming majority of the plays written between those dates include a song performed by a woman or a boy (or, in the case of Twelfth Night. seem to have included such a scene at one point); very few of the ones written before and after those years do, at least until the early 1610s, when the King’s Men seem to have found themselves another gifted boy singer.
Obviously, it’s important to the plot that Ophelia goes mad, but there’s no particular reason why her madness has to take the form of singing.