As the investigating agent on a large number of shootings, here's my take from the Federal side.
Your gun will be taken as evidence.
If you are charged, it will be held for trial.
If you plead, it will get destroyed (more on this later, though).
If you aren't charged, it will be returned.
If you are charged and convicted, it will be held for the inevitable appeal, then destroyed.
If you are tried and acquitted, it will be returned.
I took a nice 4506 from a guy who got fired from his job at an armored car company that serviced ATMs. The day after he got fired, he went ahead and serviced a bunch of ATMs, including the one in my little Montana town. The convenience store owner thought it was odd he was putting money from the ATM into his crappy Pinto, and called the cops. There was a nice little chase, some gun pointing and harsh language, and I wound up with the Smith he was wearing in evidence.
After he was convicted (guilty plea) of bank burglary in federal court, I called his Dad and asked him if he wanted the 4506 that was in evidence. He seemed surprised, but said sure thing. So I gave it to his Dad, with the instruction his felon kid couldn't have it. He seemed fine with it, and nobody ever said anything.
I see a lot of internet nonsense about not carrying a nice gun because it will wind up in evidence. Yes, it will. If it was a good shooting, you'll most likely get it back. If its not a good shooting, getting your gun back will be the least of your worries as you contemplate a change in your romantic orientation.
If for some reason you are involved in a good shooting, but don't get your gun back - big deal. You won the lottery. Be happy anyway.