Polytonality with a single key signature
In a truly polytonal piece — meaning a piece in two or more keys simultaneously — it's really the composer's choice. For example, in George Gershwin's "Impromptu in Two Keys", the key signature is three flats (for Eb major — the "principal" key of the piece) even though the melody is largely in D major. Accidentals are used for the melody, and its key is clear.
Parts with independent key signatures
In some cases a composer will use different key signatures to reflect the key of each part. One example of using different key signatures can be found in Ligeti's "Etude #7" for Piano. That piece, in which each hand is dedicated to a different whole-tone scale, uses a key signature of Eb-Db for the right hand and Bb-Ab-Gb for the left hand. Etude #12 has a key signature of no sharps/flats for the right hand and five flats for the left.
"Hybrid" key signatures
As suggested in the question, a hybrid key signature can be used, though this more often reflect a piece written in a mode or "manufactured" scale. Bartók does this, for example, in the piece addressed in Unconventional key signature: sharps on F & G only?
Lots of modulation, but not polytonality
The piece described in the question would not be considered polytonal as the various keys are not occurring simultaneously but, rather, sequentially. In that case, the key signature is most commonly determined by the key acting as "home base" — typically found at the end of the piece, presuming the ending isn't intended as ambiguous, but could also be the key that generally dominates the piece overall.
In a truly ambiguous situation, it's really up to the composer whether to use a key signature at all and, if so, which one to use. The guidance would just be to use a key signature that either best reflects the composer's intention or one that is most convenient for reading the score.