I think composers (except those formalists who believe specific keys have specific connotations inherently, and not merely "within a piece"
typically compose in one of their pet keys and then transpose, simply because it's easier on them. I write in C and then transpose, figure out key changes and modulations, etc. Irving Berlin preferred black key-based keys for his initial composition, for reasons I do not understand.
Elton John did a Town Hall on Sirius, where he talked about his divide between piano-based songs he wrote when his primary collaborator/interpreter was Paul Buckmaster the orchestrator, and guitar-based songs he wrote when his major partner was guitarist Davey Johnstone. The keys he wrote in, even initially, changed when he reconsidered which instrument his music would be based in at that time.