A guitarist I knew used to wonder why players would whirl off into rainstorms of eighth notes whenever it came time for a solo. “What’s wrong with the melody?” he would ask.
Actually, in a vocal band I usually play the melody straight if I have a solo. Sure, I’ll decorate a bit, but the audience is either dancing or talking, and in both cases they want things to stay in line. In a jam band, however, they already heard me play the melody on the head. There’s an unwritten rule that you don’t repeat the whole form, but rather offer something new to say.
Still, it’s a good starting point. If you’re new to improv, or if you just can’t get a handle on a song, play bits of the melody. Take some liberties, insert something if you get an idea, build on it. Do sexy music theory stuff like retrograde inversions. Or just stay pretty close; at least you know it’ll fit, and we’re trying to play music, not impress anybody.
I was having trouble with St. Thomas, and this guy laid it out: GelZero on YouTube playing St. Thomas. I don’t know who he is, but the dude knows how it’s done.
But to the original point, I want to hear a player put something of themselves into it, but I want to hear that from a player that is able to do the song as it is.