We study the transition in dimensionality of a three-dimensional magnetohydrodynamic flow forced only mechanically, when the strength of a magnetic guiding field is gradually increased. We use numerical simulations to consider cases in which the mechanical forcing injects (or not) helicity in the flow. As the guiding field is increased, the strength of the magnetic field fluctuations decrease as a power law of the guiding field intensity. We show that for strong enough guiding fields, the helical magnetohydrodynamic flow can become almost two-dimensional. In this case, the mechanical energy can undergo a process compatible with an inverse cascade, being transferred preferentially towards scales larger than the forcing scale. The presence of helicity changes the spectral scaling of the small magnetic field fluctuations, and affects the statistics of the velocity field and of the velocity gradients. Moreover, at small scales the dynamics of the flow becomes dominated by a direct cascade of helicity, which can be used to derive scaling laws for the velocity field.