Green’s Dictionary of Slang

foreigner n.

1. (US Und.) any convict who is not a professional thief.

[US]Ersine Und. and Prison Sl.

2. (US prison) an inmate serving a sentence for sex crimes.

[US]A.J. Pollock Und. Speaks 41/2: Foreigner, a convict serving time for a sexual crime (prison).
[US]Monteleone Criminal Sl. (rev. edn) 89: foreigner One serving a sentence for sexual [...] crime.

3. (US black) one who is not a regular partner or a husband or wife.

D. Burley in Chicago Defender 20 June 10: [S]pending his bonus on ‘foreigners’ when the dear wife and babe waited at home.

4. (US black) a homosexual; thus speak in a foreign tongue v., to have oral sex [the ‘foreign tongue’ is French n. (4)].

[US]B. Rodgers Queens’ Vernacular 84: foreigner (black sl) a homosexual [...] speak In a foreign tongue (fr sl French = sucking cock) to have oral intercourse with either sex.

5. anyone who is not from one’s immediate neighbourhood.

[UK]J. Cameron Brown Bread in Wengen [ebook] [T]wo foreigners came in. Never out of Walthamstow maybe Mile End.

SE in slang uses

In compounds

foreigner’s lurk (n.) [lurk n. (1)]

one who poses as a foreigner in distress and begs for money accordingly.

[Scot]Edinburgh Rev. July 482: The Foreigner’s Lurk. — Considerable numbers proceed on this lurk, representing themselves as foreigners in distress. . . Of late years, by far the greatest number have represented themselves as Polish noblemen or gentlemen [...] driven by the tyranny of Russia from their native country.

In phrases

do a foreigner (v.) [SE foreign; i.e. somewhere ‘away from home’]

for a worker contracted to one job to take time off illegally to tackle another, more lucrative, one .

[Aus]Truth (Melbourne) 29 Aug. 1/6: The joke going around [...] is that railway workshops men will be given an extra shilling a day in the Expeditionary Force, because some of them are particuarly good on ‘foreigners’ (workshop slang for private work done in Government time).
[UK]Hunt & Pringle Service Sl. 33: Such articles [i.e. model aircraft], made in the ‘firm’s’ time and with the ‘Company’s’ material, are called ‘foreigners’, as they are outside the normal work done by the employee or airman or soldier.
[UK]P. Wright Lang. British Industry 34: The term, now rapidly gaining ground, e.g. among decorators [...] doing a foreigner [...] means working privately, unknown to the Inland Revenue, to supplement one’s regular wage [OED].
A. Bleasdale Shop thy Neighbour 111: We’re both gettin’ followed, for all we know, we’re both goin’ t’get prosecuted f’doin’ a foreigner while we’re on the dole .
This is Wirral 17 Nov. 🌐 He said he had been approached by the police because his double glazing company had been doing some legitimate work at the murdered woman’s home in Buffs Lane, Heswall. He also told her that he had not told the police he had actually been at her house on the Saturday of her death doing ‘a foreigner’.
A. Beckett Promised You a Miracle [ebook] Moonlighting, ‘doing a job on the side’, ‘doing a foreigner’ – a strong British xenophobia lingered in the early 1980s.