from nilearn.image import clean_img is a function built to operate directly on 4D Nifti image (built around signal.clean). May be its worth to try with this function.
While if you are building pipelines, then NiftiMasker or MultiNiftiMasker can do that for you at transform level.