Edit: Regular contributor Habeas Corpus has alerted me that the Victorian Court of Appeal has clearly rejected the reasoning in Moh v Pine in Guden v The Queen  VSCA 196. Deportation at the end of a period of imprisonment is a legitimate sentencing consideration in this state (subject to it being of sufficient likelihood for the Court to appropriately consider it). Maxwell P, Bongiorno JA and Beach AJA [at 25]:
25 In our view, authority does not require, and there is no sentencing principle which would justify, a conclusion that the prospect of an offender’s deportation is an irrelevant consideration in the sentencing process. As a matter of principle, the converse must be true. Like so many other factors personal to an offender which conventionally fall for consideration, the prospect of deportation is a factor which may bear on the impact which a sentence of imprisonment will have on the offender, both during the currency of the incarceration and upon his/her release.
Contrast with the Court of Appeal’s decision in Ngyuen v The Queen  VSCA 244. Both sides conceded that the judge had erred by failing to impose a non-parole period because of the almost certain prospect of the offender (who had overstayed their visitor’s visa) would be deported when released from prison. The Court of Appeal held that both Strethsa and the relevant provisons of the Sentencing Act required consideration of a non-parole period to ignore the prospect of deportation.
Weinberg JA [at 4]:
4 The authorities make it clear that the likelihood that a person will be deported after that person has completed his or her actual custodial sentence is entirely irrelevant when considering whether a non-parole period should be fixed.
and at 23:
23 Whether or not the appellant is, in fact, deported, as seems almost certain, is of course a matter for the executive, and has nothing whatever to do with this Court’s disposition of this appeal.
I’ve frequently heard the effect of a criminal sanction on a foreign national raised as mitigation in the Magistrates’ Court. For example, a court may be told, ‘my client currently has a visa application under consideration, and a conviction for these charges will probably spell the end to that’.
Given that courts often take into account the potential consequences of their sentences on an offender’s employment prospects or travel plans (see the Elucubrator’s Have conviction, will travel from last year) this hardly seems unreasonable.
I was surprised to read the other day that migration implications are, ‘a matter for immigration authorities and not a matter that the court could consider’: Moh v Pine  ACTSC 27 at 43. In that case, the ACT Supreme Court held that a magistrate had been wrong to take into account when sentencing that the accused might be deported and refused re-entry to Australia.
Support for this view was said to come from R v Tsui (1985) 1 NSWLR 308, [Street CJ at 310],
The two matters of serving out sentences passed by criminal courts and of
implementing the immigration laws stand in entirely separate compartments.
The Commonwealth stands back in order to allow the criminal and penal
laws and orders to be carried through to the point where the criminal is freed
from custody. The Commonwealth then proceeds in accordance with the
policy enunciated by the Minister on its behalf.
That case dealt with the refusal to specify a non-parole period of a person who was likely to be deported after serving sentence. The principle has been carried through more broadly, notably in Dauphin v R  WASCA 104 where Steytler J said at 21 -22 (Anderson and Mechechnie JJ agreeing):
Secondly, counsel for the applicant informed the Court that she had recently been advised that the applicant will be deported to New Zealand at the completion of his sentence. She suggested that this should be taken into account by the Court when considering the appropriate sentence to be imposed, particularly in light of the prospect of reconciliation between the applicant and his de facto partner and the fact that the applicant no longer has any connection to his country of birth.
 In my opinion, this submission is without merit. In R v Chi Sun Tsui (1985) 1 NSWLR 308 at 311, Street CJ (with whom the other members of the Court were in agreement) said that “the prospect of deportation is not a relevant matter or consideration by a sentencing Judge, in that it is the product of an entirely separate legislative policy area of the regulation of society”. Those remarks were cited with apparent approval by Brennan and McHugh JJ in R v Shrestha (1991) 173 CLR 48 at 58. Furthermore, as McPherson JA explained in R v S  QCA 531 at , taking the prospect of the applicant’s deportation into consideration has the potential to “produce a regime under which visitors or non-permanent residents [are] sentenced more leniently than Australians who [have] committed the same kind of offence. That cannot be a proper result in the administration of justice”.
In Islam v R  ACTCA 21 the ACT Court of Appeal explicitly endorsed a paragraph of Doyle CJ’s judgment in R v Berlinsky  SASC 316 where his Honour said [at 27],
… at the end of the day the Judge had to impose an appropriate sentence having regard to the relevant circumstances. It would be wrong for the Judge to impose a lesser sentence than was appropriate on the basis that the shorter the sentence the better the prospects of the Minister permitting Ms Berlinsky to avoid deportation. And as to the fact of deportation, there was really nothing that the judge could do. The risk was there, whatever the Judge might do. While the risk of deportation is a matter that naturally arouses one’s sympathy, it is difficult to see how it can affect the sentencing process. As Ms Abraham QC, counsel for the respondent, correctly pointed out, deportation is a matter for the Executive Government. It is irrelevant, as such, as a sentencing consideration.
In R v Latumentan & Murwanto  NSWCCA 70 the principle that the prospect of deportation is not a matter properly to be taken into account for sentencing purposes was described as ‘well settled’ by Studdert J [at 19]. Cummins J also described the principle as ‘well settled’ [at 42] when sentencing an offender in the case of DPP v Zhou  VSC 239, suggesting there’s a uniform approach across the Australian jurisdictions.