The largest number of moves is
35
There are many such moves sequences, for example this:
LLLURRRURULUURDRUUULLDLULDDDLDRRDLL
I used a computer for this, but here is a handwavey argument for why this is optimal.
This is very close to being a De Bruijn sequence. The difference is that we are not stringing together all possible $4^3$ triplets of moves, but are restricted to using only the $4\cdot 3\cdot 3=36$ triplets where a move is not immediately followed by its reverse.
If there were no further restriction on revisiting squares, we could string together these $36$ triplets to get a $38$ move sequence. Here is one example:
LLLURRRURULUURDRUUULLDLULDDRDDDLDRRD(LL)
It can be proved that the last two moves will always be equal to the first two, so it is really a cycle. Note also that this $36$-move cycle contains every move exactly $9$ times. Performing that cycle will therefore bring the robot back to its starting position on the $36$th move.
So if you follow such a cycle and cannot revisit any squares, then you cannot do better than $35$ moves.
The above is not quite a proof, as it assumes that the optimal sequence is actually simply a part of such a cycle. I do believe however that it is essentially always the case that the three unused triplets can be appended or inserted to make a complete cycle. In the solution the missing triplets were DDR, DRD, RDD and they can be inserted by replacing DD by DDRDD resulting in the cycle I show above.
A solution to the bonus question:
LLLULLDLUULDDDLDRDLL
This ends up $(9,3)$ away from the start, a distance of $\sqrt{90}$.
I have no argument for why this must be optimal, though my computer program exhaustively tried all possibilities and found nothing better.