and even if the N reg is overseas and the student is training towards an FAA/IR, he/she will still require TSA security clearance.
What determines the "towards" bit?
IMHO, this cannot ever be determined if the flight is some ad hoc flight which just happens to end up in the logbook whose content is later used towards the FAA IR.
Especially if done with an instructor who has no FAA instructor qualifications, or does have those but has non-FAA ones also.