I'm now imagining a craft that folds up its solar panels before dipping into the atmosphere to gather fuel / accelerate. I'm sure I've built that in KSP, :p.
That is not particulary far-fetched either: the ISS already reorients its solar panels when not illuminated by the sun. They call it the "night glider mode" [1].
Here's an example where the authors propose doing this for planetary gravity assists, e.g., instead of using Venus for a normal gravity assist, dig into its atmosphere. Everything would need to be folded up first.
[1] https://en.wikipedia.org/wiki/Night_Glider_mode