Complete and tractable machine-independent characterizations of second-order polytime (Logical Methods in Computer Science, 2025)