When Paul McCartney had trouble working through a song (hard to imagine, but yes it happened), he found simply invoking another songwriter helped limit the anxiety of production. Per American Songwriter:
It frees you up,’ he writes. In the end, though you put on the mask of another artist (in the case of this song it was Ray Charles), you’ll find it was your song all along: ‘The song takes on its own character.’
This way, if what you are writing doesn’t work out, it’s not on you but the writer you’re imitating. If it does, well, you can always thank them in the acknowledgements.
