A 3-D numerical investigation is performed to evaluate the effect of variable twist pitch on the hydrothermal behavior and entropy generation features of non-Newtonian water-CMC/CuO nanofluid (NF) flow inside a twisted tube with a square cross-section. Three twisted tubes with a length of 500 mm, each of which has 3 twists, are considered. The first tube (Case I) has a constant twist pitch of 100 mm, while the twist pitch of Case II (150.0, 127.5, 100.8, 74.2, and 47.5 mm) and Case III (190, 144.6, 97.9, 51.3, and 6.2 mm) are variable. The simulations are performed using the two-phase mixture method considering different nanoparticle concentrations (ϕs) of 0–3% and Reynolds numbers (Res) of 600–1500. Based on the results, the highest and lowest overall hydrothermal performance was obtained for Case II and Case I, respectively. Moreover, the lowest ratios of thermal and frictional entropies of NF flow in the twisted tube to those of the plain tube were obtained for Case II. As another novelty of the current work, an evolutionary machine learning approach, namely, gene expression programming (GEP), was adopted to simulate the first law and second law performances of the NF in Case III.