If the pilot is a Federal Flight Deck Officer they just show their ID and there’s no screening. They go through background checks and federal law enforcement training. A regular pilot would be in trouble if caught with a firearm going through security. Anyone can have a firearm in their checked baggage if it is declared when checked.