No way with a .40 unless the first two grazed or were minor wounds.
When I was training as an EMT back in NY in the 70s we had a presentation by the NY City medical examiner. They showed slides from autopsies, including one of a guys head with 9 bullet holes in it. The coroner asked if it was murder or suicide. Everyone but me said murder. The doctor said that I was correct but asked how I knew. My explanation was simple logic that there was no sense in asking the question if it was murder, therefore it had to be suicide.
He told the story that the guy had gone to shoot himself in the head and 4 times he flinched as he pulled the trigger. It was a little gun, maybe 22 or 25 caliber, and those shots ended up passing under the scalp but didn’t penetrate the skull and he had 4 entry and 4 exit wounds from that, total of 8 bullet holes. He then took the gun and put it to his forehead for hole number 9. End of story.
But that wasn’t a 40 caliber
Maybe this guy had rigged the gun to make it fire full auto or in a 3 shot burst?