Just for fun, I created a CC0-1.0/Public Domain tool page,
here, that works even if copied to your own computer, with no internet access), to experiment with the frequency spectrum needed to represent pulse trains, and the "Gibbsy"-like overshoot issues related to filters constructed using frequency response truncation.
The base pulse train is described by the infinite Fourier series with \$b_n = 4/(\pi\,n)\$ for odd \$n \ge 1\$, \$b_n = 0\$ for even \$n\$, and \$a_n = 0\$ for all \$n\$. You can supply different constants in the input boxes, one per line, and when you tab away or click on the
Calculate at top, it'll redraw the signal represented by the Fourier series coefficients.
At the background, you'll see a digital pulse with period 2.
If you use
bn =
4/(n*PI) 0 4/(n*PI) 0 4/(n*PI) 0 4/(n*PI) 0 4/(n*PI),
an = 0 you can see what the background pulse would look like, when filtered by a low-pass filter that passes all frequencies at and below nine times the pulse frequency as-is, but blocks all frequencies at and above eleven times the pulse frequency completely. The overshoot is the maximum, and pretty horrible.
The default
3.9/(n*PI) 0 3.4/(n*PI) 0 2.4/(n*PI) 0 1.5/(n*PI) 0 0.5/(n*PI) shows the effect of a theoretical filter that only affects amplitude, causes no phase shift, attenuating the pulse frequency by 1-3.9/4.0=2.5%, by 15% at triple the frequency, by 40% at five times the frequency, by 62.5% at seven times the frequency, by 87.5% at nine time the frequency, and blocks all frequencies above eleven times the pulse frequency. The slew rate isn't high, but there is very little overshoot.
The idea here is to show that even if you had a perfect filter, to avoid overshoot you need to attenuate the higher frequencies at or above your signal frequency: you cannot have a steep stopband and no attenuation below it. You could limit the slew rate instead –– corresponding to a filter whose frequency response varies depending on the signal. And, that something like 10× the signal base frequency seems sufficient width for the attenuation band to recreate the original digital pulses (with very high input slew rate) with little to no overshoot, as an initial guess based on the default example. I think you can construct a filter with narrower attenuation band by allowing phase distortion, but didn't delve into this that deep.
Finally, that devices with slew-rate limited outputs don't necessarily need more than say 10× the original digital signal frequency to be reproduced well, as shown by the frequency-limited default synthesized pulse shows.