A faster way to solve this problem is to use set operations to check what numbers already exist in a certain row/column/box instead of always iterating over them.
You could start by iterating over the entire board, constructing a set for each row/column/box, and then use a similar backtracking algorithm that uses those sets to check if a value at a certain position is valid.