diff --git a/reviewboard/accounts/models.py b/reviewboard/accounts/models.py
index f4f1c66c88fe18fc0edad2ae55d5e47a1c42a92d..b05bcb91e92a48ecbdcc31f01a5e79b05551aa50 100644
--- a/reviewboard/accounts/models.py
+++ b/reviewboard/accounts/models.py
@@ -2,7 +2,8 @@
 
 from __future__ import annotations
 
-from typing import ClassVar
+from typing import (Any, ClassVar, Dict, List, Optional, Set, Tuple,
+                    TYPE_CHECKING, Union)
 from uuid import uuid4
 
 from django.contrib.auth.models import User
@@ -31,9 +32,13 @@ from reviewboard.reviews.models import Group, ReviewRequest
 from reviewboard.reviews.signals import (reply_published,
                                          review_published,
                                          review_request_published)
-from reviewboard.site.models import LocalSite
+from reviewboard.site.models import AnyOrAllLocalSites, LocalSite
 from reviewboard.site.signals import local_site_user_added
 
+if TYPE_CHECKING:
+    from djblets.avatars.services.base import AvatarService
+    from reviewboard.accounts.trophies import TrophyType
+
 
 class ReviewRequestVisit(models.Model):
     """
@@ -67,8 +72,13 @@ class ReviewRequestVisit(models.Model):
 
     objects: ClassVar[ReviewRequestVisitManager] = ReviewRequestVisitManager()
 
-    def __str__(self):
-        """Return a string used for the admin site listing."""
+    def __str__(self) -> str:
+        """Return a string used for the admin site listing.
+
+        Returns:
+            str:
+            The str for the admin site listing.
+        """
         return 'Review request visit'
 
     class Meta:
@@ -205,12 +215,15 @@ class Profile(models.Model):
     objects: ClassVar[ProfileManager] = ProfileManager()
 
     @property
-    def should_use_rich_text(self):
+    def should_use_rich_text(self) -> bool:
         """Get whether rich text should be used by default for this user.
 
         If the user has chosen whether or not to use rich text explicitly,
         then that choice will be respected. Otherwise, the system default is
         used.
+
+        Type:
+            bool
         """
         if self.default_use_rich_text is None:
             siteconfig = SiteConfiguration.objects.get_current()
@@ -220,7 +233,7 @@ class Profile(models.Model):
             return self.default_use_rich_text
 
     @property
-    def should_enable_desktop_notifications(self):
+    def should_enable_desktop_notifications(self) -> bool:
         """Return whether desktop notifications should be used for this user.
 
         If the user has chosen whether or not to use desktop notifications
@@ -269,7 +282,11 @@ class Profile(models.Model):
         """
         self.settings['ui_theme'] = theme
 
-    def get_starred_review_groups_count(self, *, local_site=None):
+    def get_starred_review_groups_count(
+        self,
+        *,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> int:
         """The number of starred review groups.
 
         This value is computed and stored in shared cache, to reduce lookups.
@@ -313,7 +330,11 @@ class Profile(models.Model):
 
         return count or 0
 
-    def get_starred_review_requests_count(self, *, local_site=None):
+    def get_starred_review_requests_count(
+        self,
+        *,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> int:
         """The number of starred review requests.
 
         This value is computed and stored in shared cache, to reduce lookups.
@@ -357,7 +378,11 @@ class Profile(models.Model):
 
         return count or 0
 
-    def has_starred_review_groups(self, *, local_site=None):
+    def has_starred_review_groups(
+        self,
+        *,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> bool:
         """Whether the user has starred review groups.
 
         The result is based on a shared cache, to reduce lookups.
@@ -384,7 +409,11 @@ class Profile(models.Model):
         """
         return self.get_starred_review_groups_count(local_site=local_site) > 0
 
-    def has_starred_review_requests(self, *, local_site=None):
+    def has_starred_review_requests(
+        self,
+        *,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> bool:
         """Whether the user has starred review requests.
 
         The result is based on a shared cache, to reduce lookups.
@@ -413,7 +442,10 @@ class Profile(models.Model):
 
         return count > 0
 
-    def is_review_group_starred(self, review_group):
+    def is_review_group_starred(
+        self,
+        review_group: Group,
+    ) -> bool:
         """Return whether a review group has been starred.
 
         Version Added:
@@ -439,7 +471,10 @@ class Profile(models.Model):
             )
         )
 
-    def is_review_request_starred(self, review_request):
+    def is_review_request_starred(
+        self,
+        review_request: ReviewRequest,
+    ) -> bool:
         """Return whether a review request has been starred.
 
         Version Added:
@@ -465,7 +500,10 @@ class Profile(models.Model):
             )
         )
 
-    def star_review_request(self, review_request):
+    def star_review_request(
+        self,
+        review_request: ReviewRequest,
+    ) -> None:
         """Star a review request.
 
         This will mark a review request as starred for this user and
@@ -488,7 +526,10 @@ class Profile(models.Model):
         self._invalidate_starred_review_requests_count_cache(
             review_request.local_site_id)
 
-    def unstar_review_request(self, review_request):
+    def unstar_review_request(
+        self,
+        review_request: ReviewRequest,
+    ) -> None:
         """Unstar a review request.
 
         This will mark a review request as unstarred for this user and
@@ -511,7 +552,10 @@ class Profile(models.Model):
         self._invalidate_starred_review_requests_count_cache(
             review_request.local_site_id)
 
-    def star_review_group(self, review_group):
+    def star_review_group(
+        self,
+        review_group: Group,
+    ) -> None:
         """Star a review group.
 
         This will mark a review group as starred for this user and
@@ -527,7 +571,10 @@ class Profile(models.Model):
         self._invalidate_starred_review_groups_count_cache(
             review_group.local_site_id)
 
-    def unstar_review_group(self, review_group):
+    def unstar_review_group(
+        self,
+        review_group: Group,
+    ) -> None:
         """Unstar a review group.
 
         This will mark a review group as unstarred for this user and
@@ -543,12 +590,17 @@ class Profile(models.Model):
         self._invalidate_starred_review_groups_count_cache(
             review_group.local_site_id)
 
-    def __str__(self):
-        """Return a string used for the admin site listing."""
+    def __str__(self) -> str:
+        """Return a string used for the admin site listing.
+
+        Returns:
+            str:
+            The username for the admin site listing.
+        """
         return self.user.username
 
     @property
-    def avatar_service(self):
+    def avatar_service(self) -> AvatarService:
         """The avatar service the user has selected.
 
         Returns:
@@ -559,7 +611,10 @@ class Profile(models.Model):
         return avatar_services.get_or_default(service_id)
 
     @avatar_service.setter
-    def avatar_service(self, service):
+    def avatar_service(
+        self,
+        service: AvatarService,
+    ) -> None:
         """Set the avatar service.
 
         Args:
@@ -569,7 +624,10 @@ class Profile(models.Model):
         self.settings.setdefault('avatars', {})['avatar_service_id'] = \
             service.avatar_service_id
 
-    def get_display_name(self, viewing_user):
+    def get_display_name(
+        self,
+        viewing_user: User,
+    ) -> str:
         """Return the name to display to the given user.
 
         If any of the following is True and the user this profile belongs to
@@ -600,7 +658,11 @@ class Profile(models.Model):
         else:
             return self.user.username
 
-    def save(self, *args, **kwargs):
+    def save(
+        self,
+        *args,
+        **kwargs,
+    ) -> None:
         """Save the profile to the database.
 
         The profile will only be saved if the user is not affected by read-only
@@ -616,7 +678,10 @@ class Profile(models.Model):
         if not is_site_read_only_for(self.user):
             super(Profile, self).save(*args, **kwargs)
 
-    def _build_starred_review_groups_count_cache_key(self, local_site):
+    def _build_starred_review_groups_count_cache_key(
+        self,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> str:
         """Build a cache key for a user's starred review group counts.
 
         Version Added:
@@ -641,7 +706,10 @@ class Profile(models.Model):
             key_name='starred-review-groups-count',
             local_site=local_site)
 
-    def _build_starred_review_requests_count_cache_key(self, local_site):
+    def _build_starred_review_requests_count_cache_key(
+        self,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> str:
         """Build a cache key for a user's starred review request counts.
 
         Version Added:
@@ -666,7 +734,11 @@ class Profile(models.Model):
             key_name='starred-review-requests-count',
             local_site=local_site)
 
-    def _build_starred_item_cache_key(self, key_name, local_site):
+    def _build_starred_item_cache_key(
+        self,
+        key_name: str,
+        local_site: Optional[Union[AnyOrAllLocalSites, int]] = None,
+    ) -> str:
         """Build a cache key for a user's starred item counts.
 
         Version Added:
@@ -705,7 +777,10 @@ class Profile(models.Model):
 
         return '%s-%s-%s' % (key_name, local_site_id, self.pk)
 
-    def _invalidate_starred_review_requests_count_cache(self, local_site=None):
+    def _invalidate_starred_review_requests_count_cache(
+        self,
+        local_site: Optional[Union[int, LocalSite]] = None,
+    ) -> None:
         """Invalidate the starred review requests count cache.
 
         Version Added:
@@ -721,7 +796,10 @@ class Profile(models.Model):
             for _local_site in (local_site, LocalSite.ALL)
         )
 
-    def _invalidate_starred_review_groups_count_cache(self, local_site=None):
+    def _invalidate_starred_review_groups_count_cache(
+        self,
+        local_site: Optional[Union[int, LocalSite]] = None,
+    ) -> None:
         """Invalidate the starred review groups count cache.
 
         Version Added:
@@ -798,7 +876,11 @@ class LocalSiteProfile(models.Model):
     objects: ClassVar[LocalSiteProfileManager] = LocalSiteProfileManager()
 
     def __str__(self):
-        """Return a string used for the admin site listing."""
+        """Return a string used for the admin site listing.
+
+        Returns:
+            str:
+            The username and local_site for the admin site listing."""
         return '%s (%s)' % (self.user.username, self.local_site)
 
     class Meta:
@@ -832,11 +914,11 @@ class Trophy(models.Model):
     objects: ClassVar[TrophyManager] = TrophyManager()
 
     @cached_property
-    def trophy_type(self):
+    def trophy_type(self) -> TrophyType:
         """The TrophyType instance for this trophy."""
         return trophies_registry.get_for_category(self.category)
 
-    def get_display_text(self):
+    def get_display_text(self) -> str:
         """Get the display text for this trophy."""
         return self.trophy_type.get_display_text(self)
 
@@ -850,7 +932,10 @@ class Trophy(models.Model):
 # The following functions are patched onto the User model.
 #
 
-def _is_user_profile_visible(self, user=None):
+def _is_user_profile_visible(
+    self,
+    user: Optional[User] = None,
+) -> bool:
     """Return whether or not the given user can view this user's profile.
 
     Profiles are hidden from unauthenticated users. For authenticated users, a
@@ -889,7 +974,7 @@ def _is_user_profile_visible(self, user=None):
             user.is_admin_for_user(self))
 
 
-def _has_private_profile(self):
+def _has_private_profile(self) -> bool:
     """Return whether the user's profile is marked as private.
 
     Version Added:
@@ -907,7 +992,7 @@ def _has_private_profile(self):
     return bool(profile and profile.is_private)
 
 
-def _should_send_email(self):
+def _should_send_email(self) -> bool:
     """Get whether a user wants to receive emails.
 
     This is patched into the user object to make it easier to deal with missing
@@ -916,7 +1001,7 @@ def _should_send_email(self):
     return self.get_profile().should_send_email
 
 
-def _should_send_own_updates(self):
+def _should_send_own_updates(self) -> bool:
     """Get whether a user wants to receive emails about their activity.
 
     This is patched into the user object to make it easier to deal with missing
@@ -925,8 +1010,12 @@ def _should_send_own_updates(self):
     return self.get_profile().should_send_own_updates
 
 
-def _get_profile(self, cached_only=False, create_if_missing=True,
-                 return_is_new=False):
+def _get_profile(
+    self,
+    cached_only: bool = False,
+    create_if_missing: bool = True,
+    return_is_new: bool = False,
+) -> Union[Optional[Profile], Tuple[Profile, bool]]:
     """Return the profile for the User.
 
     The profile will be cached, preventing queries for future lookups.
@@ -1013,8 +1102,13 @@ def _get_profile(self, cached_only=False, create_if_missing=True,
     return profile
 
 
-def _get_site_profile(self, local_site, cached_only=False,
-                      create_if_missing=True, return_is_new=False):
+def _get_site_profile(
+    self,
+    local_site: Optional[LocalSiteProfile] = None,
+    cached_only: bool = False,
+    create_if_missing: bool = True,
+    return_is_new: bool = False,
+) -> Union[Optional[LocalSiteProfile], Tuple[bool, LocalSiteProfile]]:
     """Return the LocalSiteProfile for a given LocalSite for the User.
 
     The site profile will be cached, preventing queries for future lookups.
@@ -1097,7 +1191,10 @@ def _get_site_profile(self, local_site, cached_only=False,
     return site_profile
 
 
-def _is_admin_for_user(self, user):
+def _is_admin_for_user(
+    self,
+    user: User,
+) -> bool:
     """Return whether or not this user is an administrator for the given user.
 
     Results will be cached for this user so that at most one query is done.
@@ -1135,7 +1232,7 @@ def _is_admin_for_user(self, user):
     return False
 
 
-def _get_local_site_stats(self):
+def _get_local_site_stats(self) -> Dict[str, List[int] | str]:
     """Return statistics on LocalSite membership for this user.
 
     Version Added:
@@ -1240,7 +1337,12 @@ def _call_unarchive_all_for_reply(sender, reply, **kwargs):
 
 @receiver(user_registered)
 @receiver(local_site_user_added)
-def _add_default_groups(sender, user, local_site=None, **kwargs):
+def _add_default_groups(
+    sender: Any,
+    user: User,
+    local_site: Optional[LocalSite] = None,
+    **kwargs,
+) -> None:
     """Add user to default groups.
 
     When a user is registered, add the user to global default groups.
@@ -1259,8 +1361,13 @@ def _add_default_groups(sender, user, local_site=None, **kwargs):
 
 
 @receiver(m2m_changed, sender=Group.users.through)
-def _on_group_user_membership_changed(instance, action, pk_set, reverse,
-                                      **kwargs):
+def _on_group_user_membership_changed(
+    instance: Group,
+    action: str,
+    pk_set: Set[int],
+    reverse: bool,
+    **kwargs,
+) -> None:
     """Handler for when a review group's membership has changed.
 
     When a user is added to or removed from a review group, their
