what I should do when I'm playing a piece that contains both slash cords and non-slash cords.
Fake books normally don't contain original arrangements or compositions. Like the editor or arranger has supposed to play a chord in root position or a slash chord (which might be an inversion - s. the comment by Tom) it is always up to you as improviser to play the bass line like you want (root or inversions) and what you think sounds fine. You can also play passing tones as many as you like to make an interesting bass line or play some riffs below the chords.
Does this mean I'm free to invert the non-slash chords whenever I feel it's a good idea?
Exactly, you are now the arranger, composer, you are not the slave of any other.
Does the presence of slash chords imply that the other chords are meant to be played in root position?
No, except of the final chord! Most others could be inversions, but you will find out that often on the beginning of a phrase the root position is preferable, or at the 1st beat in a measure, every second beat could be the fourth or a passing tone.
Play some chorals, pop songs and analyze when there are inversions.
Even if the book doesn't propose an inversion you can e.g. play a progression I-Ib7-IV-IVm in the bass C - Bb - A - Ab etc.
It's like you say: If you feel it's a good idea ... just do what you want!