The amplification of astrophysical magnetic fields takes place via dynamo instability in turbulent environments. Vorticity is usually present in any dynamo, but its role is not yet fully understood. This work is an extension of previous research on the effect of an irrotational subsonic forcing on a magnetized medium in the presence of rotation or a differential velocity profile. We aim to explore a wider parameter space in terms of Reynolds numbers, the magnetic Prandtl number, the forcing scale, and the cooling timescale in a Newtonian cooling. We studied the effect of imposing that either the acceleration or the velocity forcing function be curl-free and evaluated the terms responsible for the evolution vorticity. We used direct numerical simulations to solve the fully compressible, resistive magnetohydrodynamic equations with the Pencil Code. We studied both isothermal and non-isothermal regimes and addressed the relative importance of different vorticity source terms. We report no small-scale dynamo for the models that do not include shear. We find a hydro instability, followed by a magnetic one, when a shearing velocity profile is applied. The vorticity production is found to be numerical in the purely irrotational acceleration case. Non-isothermality, rotation, shear, and density-dependent forcing, when included, contribute to increasing the vorticity. As in our previous study, we find that turbulence driven by subsonic expansion waves can amplify the vorticity and magnetic field only in the presence of a background shearing profile. The presence of a cooling function makes the instability occur on a shorter timescale. We estimate critical Reynolds and magnetic Reynolds numbers of 40 and 20, respectively.